create action

Good morning
I am looking for a way so that when filling out a form the data is copied into two tables, in table A I copy all the fields, and in table B I copy only 3 fields: id table A, name of the Product and the quantity, this is how To do so, what I'm really looking for is that only unique fields remain in table B.
If in table b there are two matching values โ€‹โ€‹IdTable_A and the name of the product, do not add them, but add the amount of the product that is spent.

Buenos dรญas
Busco la manera de que al rellenar un formulario se copien los datos en dos tablas en la tabla A me copie todos los campos, y en el la tabla B me copie solo 3 campos id tabla A, nombre del Producto y la cantidad esto se como hacerlo, lo que realmente busco es que en la tabla B solo quden campos unicos.
Si en la tabla b existe dos valores coincidentes IdTabla_A adeMas el nombre del producto no los aรฑada, pero si que me sume la cantidad del producto que se gasta

 

Solved Solved
0 10 234
1 ACCEPTED SOLUTION

I would suggest the following solution:

Tables

Create a table "Product" with following columns:

  • ID product
  • Product name
  • ...

Create a table "Purchase" (or whatever is best for you) with the following columns:

  • ID purchase
  • Product (Ref to product table)
  • Quantity

Create a table "Product quantity" with the following columns:

  • ID product
  • Product name
  • Quantity total

Automations

When a new row is added (then you should also handle updates and deletes i guess) in the Product table then copy the ID and the Product name in the Product quantity table, so:

Trigger: Row is added to the Product table

Process: Run a data action -> Add new rows (to Product quantity table)

  • ID product (Product quantity table) = [_thisrow].[ID product] (Product table)
  • Product name (Product quantity table) = [_thisrow].[Product name] (Product table)

As you see, "quantity total" is missing. Assuming you are using Google Sheets, you can add this formula in your sheet to calculate the total quantity:

sumif('Product Quantity'!B:B, C2; 'Product Quantity'!C:C)

Here i am just assuming that you have a Product quantity sheet and that the Column B is Product (Ref) and column C is Quantity. 

I am assuming in B2 you have the quantity total column 

Explanation

You have a list of products (Product table) and when you add an item to this list it will be copied to the Product quantity table. 

When you add an item, with its quantity, to the Purchase table, the quantity field in the Product quantity table is automatically updated. 

 

View solution in original post

10 REPLIES 10

Create two actions as "Add row to another table" and then group them. When the form view is saved, trigger this grouped action with the "Event action". That you can find from the system generated Form view.

Hello,

I would create an action that is triggered when an item in table A is added.  The action would do the following:

  • IF "ID Table A" does not exist in "Table B" then
    • ID (tableB) = [_THISROW].[ID TABLE A]
    • name =  [_THISROW].[name]
    • quantity = [_THISROW].[quantity]
  • ELSE find the item by ID TABLE A and set
    • quantity = quantity + [_THISROW].[quantity]

Error Cannot compare List with Text in (ListaTareas[IdTarea] = [_ThisRow].[IdTarea])

ifS(ListaTareas[IdTarea]=[_ThisRow].[IdTarea],TRUE,ListaTareas[IdStock]=[_ThisRow].[IdStock],sum(_THISROW.[Salida]+ListaTareas[Salida],True))

Hello @juan_1963 ,

Where did you use these formulas?

Sorry in my previous post i said "Action" but i meant "Automation"... you need to create an automation that is triggered when an item in table A is added...

and the action:
pantalla action.png

 

And I thought I would put the action on the form:
form action.png

It is what I want to do

Hello, 

If you use actions then the data won't be automatically copied to the other table, you will need to press a button to achieve that, use automations instead.

Cab you tell us a bit more about the problem with an example with explanation? Maybe we can find another solution to your problem. 

If i understand well you have a table where you add items let's say you add:

  • Radio, 3
  • Television, 1
  • Computer, 2
  • Radio, 4
  • Computer, 3

Where the number is the quantity...

Then you want another table that keeps track of the overall quantity...then table 2 will look like this:

  • Radio, 7
  • Television, 1
  • Computer, 5

Am i right or i am missing something?

 

I would suggest the following solution:

Tables

Create a table "Product" with following columns:

  • ID product
  • Product name
  • ...

Create a table "Purchase" (or whatever is best for you) with the following columns:

  • ID purchase
  • Product (Ref to product table)
  • Quantity

Create a table "Product quantity" with the following columns:

  • ID product
  • Product name
  • Quantity total

Automations

When a new row is added (then you should also handle updates and deletes i guess) in the Product table then copy the ID and the Product name in the Product quantity table, so:

Trigger: Row is added to the Product table

Process: Run a data action -> Add new rows (to Product quantity table)

  • ID product (Product quantity table) = [_thisrow].[ID product] (Product table)
  • Product name (Product quantity table) = [_thisrow].[Product name] (Product table)

As you see, "quantity total" is missing. Assuming you are using Google Sheets, you can add this formula in your sheet to calculate the total quantity:

sumif('Product Quantity'!B:B, C2; 'Product Quantity'!C:C)

Here i am just assuming that you have a Product quantity sheet and that the Column B is Product (Ref) and column C is Quantity. 

I am assuming in B2 you have the quantity total column 

Explanation

You have a list of products (Product table) and when you add an item to this list it will be copied to the Product quantity table. 

When you add an item, with its quantity, to the Purchase table, the quantity field in the Product quantity table is automatically updated. 

 

Me estรก funcionando muy bien, me hubiera gustado poder aplicarlo con las fรณrmulas del appsheet
Una soluciรณn es mejor que ninguna soluciรณn.
Muchas gracias Julio35

You are welcome

Top Labels in this Space