Copy value to table

We manufacture metal parts on CNC machines.
Each product is made by means of several technological operations.
There is an application “Production of products”, containing tables:
№1. 1. “List of manufactured articles”.
№2. 2. “Journal of technological operations”.

After each technological operation is performed, a new record is created in the “Journal of technological operations”. (table 2.)
In the new record is entered:

  • id Products from Table No. 1. ( to the column [Product] ).
  • number of the executed operation ( in the column [Operation] ).

The task:
When creating each new record in Table No. 2. , copy from it the number of the executed operation in Table No. 1. ( in the column [Current operation] ).

Thus, each executed operation updates the [Current operation] column in Table No. 1 for the corresponding product.

What I was able to do: when adding a new entry in Table No. 2. update the [Current operation] column in Table No. 1. to the text value “Updated”.

Please help: How to add the operation number from Table No. 2 instead of the text value. ?

Translated with www.DeepL.com/Translator (free version)

This is a common request - update a value in a row in another table using values from this row. Unfortunately, this ability does not directly exist yet. In the meantime, I encourage you to visit the Feature Request and Upvote it to help us get it implemented into AppSheet.


There are work arounds. But before I offer a suggestion, I am wondering if maybe there might be a better way to handle your need.

A couple questions:

  1. What is the purpose of recording the [Current Operation] into the Products Table #1? How is it used within the app?

  2. Won’t this [Current Operation] change frequently?

2 Likes

Thanks for the answer. The purpose of the [Current Operation] entry is to determine the current manufacturing status of the product. Comparing the current operation with the total number of operations, I will determine the manufacturing progress.

This [Current operation] will change after each next operation on this product (creating a new entry in the Operation Log).

Ok. I’m assuming that [Current Operation] is not just a count but a textual description of which operation is being performed?

Nothing is coming to mind for an easier/better way to handle your need.

So, below is how I would implement a work around. Others may have alternative suggestions.

I would add to Table #2 a column for “Updated?”. Then in the action that is updating Table #1, perform a an ANY(SELECT()) function to get access to the row and copy its information.

The expression might be like this:

ANY(
    SELECT(Table2[Operation], AND([Product] = [_THISROW].[Product],
                                  [Updated?] <> "TRUE"
                              )
    )
)

It is assumed that the SELECT() would return only a single row for that Product. But it is in LIST form.
ANY() gets the Text value from the first List item.

Lastly, you’ll need to add an Action step to set the “Updated?” column to “TRUE”.

I hope this helps!

1 Like

Thanks, John.