Add new records from deck

Hi there !
I have a “deck” from which the user can select based on a photograph and a brief description of a package, that is, a group of records from that same table, which make up a promotion, (could be more than 15) and I would like to “select” that record from the deck the emptying of records from the package table is generated (selected package) and the new records are generated in the inventory movement table, however …

things that I did…

  1. I select the “ACTION” that I put in the deck and it is generated but only the first record of the package in the inventory movement table, it does not do it with all records of the package …

  2. try to do it with a workflow, when modifying something in the registry, however I can only generate one registry in my inventory movement table, the one that I modify myself, but I need to do the same with all the registries that make up the package !!!

  3. During the night, I have “REPORTS” that are executed automatically and that generate records, in this case assortment orders according to the sales of the day …
    How to make a report run whenever I want …? when selecting a record, when marking it, with an ACTION
    And to read only the marked records to generate the new ones in the inventory movement table?

This third is I think the one that is closest to what I need, but I’m stuck, any ideas?

Thank you all for reading and your comments …


Just to check my understanding:
You want the user to select a record from a deck view that represents a group of items in a promotion; this promotion is a single record in the same table with multiple items. When they click on that promotion, the app should copy all items in that promotion to an inventory movement table.

I think the missing piece is you need to consider the Action: “Data: Execute an action on a set of rows”.

  1. Create an action: “Data: “add a new row to a table using values from this row” and associate it with the promotions table. This will copy a item from the promotions inventory movement table. (Note this simply is an action that can copy a row from one table to another”

  2. Create an action: “Data: Execute and action on a set of rows”, which would be associated with your promotions table, and the “reference table” is the promotions table as well. The formula you enter should be a select query which pulls up a list of Primary Keys relevant to that promotion in the promotions table. Then the referenced action will be the action created in step 1.

At this stage you have created an action that you can show for any promotion item. When the action is triggered it will look up the list of items that are relevant to that promotion and apply the copy action to each of those items from the promotion table to the inventory movement table. You can attach this action to a workflow or form save event as well to get the desired behavior.

2 Likes

@Rich Thanks for your guidance and such a good explanation …

I found this article that @steve made very detailed too …

I did what you suggest me in the app I’m working on and I couldn’t get it to work, I thought it was something in the app, that it was making this hard to work and I made a new app with just two tables so there would be no other things that interfere.

In this new app, I have not been able to make it work either …

It is the same idea, two tables, one with the PAQ promotions and the other with INVENTORY inventory movements.

  • It only generates one record in the INVENTORY table, where it should generate all the records that belong to that promotion [PAQ ID]

  • When editing in the PAQ_form form, where I put (I also tried it with APPEARANCE display prominently)
    For each row to add, do this …
    Add more rows

  • And when editing with the form, it will be very useful for me when you want several promotions, but the PAQ_form form always puts zero in QTY …


If you cannot see the app, please notify us to correct what is needed ,

I will greatly appreciate your help …
I send you photos and I share the app, the tables are google drive are already shared …


Your “add one row” action should be for the Inventory table and copy to the the same inventory table.

The action “Add more rows” reference should be the Inventory table. This tells the where to to target. Logically this means:

  1. Start in PAQ table
  2. Then I am going to trigger an action in this the Inventory table
  3. I am going to apply the action to these primary keys records in the Inventory table.
  4. I will apply the action “add one row” to each of the records I found.

Then AppSheet executes the add one row action to each record that is calculated from the Referenced rows formula.

You do not need the grouped action called “for each row to add do this”.

On form save just trigger the “Add more rows action”

thanks for your prompt reply @Rich

I did a lot of tests based on what you say (and what I knew) and now I am more confused … I think that something in the translation I do not understand … or there is a bug…

I will put into words and the same is the app that I modify according to what I understood from your instructions …

  1. the ACTION “” for each row to add do this … "will not be needed, delete it …

  2. On form, i save just trigger the “Add more rows" … action ”

  3. On Action "Add more rows” Data: add a new row
    in reference table, remove PAQ and put INVENTORY
    For a record of this table- remove PAQ and put INVENTORY

  4. On Action “add one row” Data: execute an action on a set of rows
    in -This table- remove PAQ and put INVENTORY

It could be “reference rows” ? (i tested with some and nothing)
select(PAQ[_computedkey], [PAQ ID] = [_thisrow].[PAQ ID])

As I said before, I am more confused, please help!

It does not generate a single record, and I am in doubt …

To generate the new record (point # 3) where you will get the values ​​that are in the PAQ table like the [PRICE] [DISCOUNT] and [QTY], I would suppose I would put them in [CTD] = [QTY], but … ?

the above has to do with this …
When the client wants several promotions, he could put how many in the PAQ table !
how would it be done!

Your formula for the “Add more rows” action should be targeting the Inventory table.

select(Inventory[Item ID], [PAQ ID]=[_thisrow].[PAQ ID])

[PAQ ID] is the column from your Inventory table
[_thisrow].[PAQ ID] is the column from your PAQ table.

This formula produces a list of rows from the inventory table. AppSheet then executes the Action: “Add one row” on each row in the list.

1 Like

Thx, it works !