If the data already exists then increase the quantity, if it doesn't exist then add the data

Hi everyone. So I have 2 tables, an item list table and an incoming item table with columns called item name and item quantity. I want to create automation that can check whether the name of the item entered in the incoming item form already exists or not in the item list table. If the item name already exists, then the quantity of newly arrived items will be added to the quantity currently available. If the item name does not exist, then add the item name and quantity to the item list table. Is there a way to do this? Thank You

Solved Solved
0 9 870
1 ACCEPTED SOLUTION

Hi, I think I have found the solution to my own problem. I tried tinkering with the automation code that I created and finally succeeded in making the code run. The solution to the problem I experienced is as follows (ps. sorry if there are some parts that use Indonesian):

When an item arrives and is not yet on the item list, the automation used has the following conditioning

agnispremz_0-1710226422381.png

Then, for the task to be executed, namely Run a Data Section, using behavior that has been modified like this:

agnispremz_1-1710226538372.png

Finally, if an item arrives and the item is already in the item list, then the current number of items will increase with the conditioning and code in the automation body as follows:

agnispremz_2-1710226673337.png

Code on the automation Body:

{
"Action": "Edit",
"Properties": {
"Locale": "en-US",
"Location": "47.623098, -122.330184",
"Timezone": "Pacific Standard Time"
},
"Rows": [
{
"ID Asset": "<<ANY(FILTER("Daf-tar Asset", [_THISROW].[Nama Asset]=[Nama Asset]))>>",
"Lokasi": "<<ANY(SELECT(Daf-tar Asset[Lokasi], [_THISROW].[Nama Asset]=[Nama Asset]))>>",
"Jumlah": "<<ANY(SELECT(Daf-tar Asset[Jumlah], [_THISROW].[Nama Asset]=[Nama Asset]))+[_THISROW].[Jumlah]>>"
}
]
}

View solution in original post

9 REPLIES 9