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…
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 …
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 !!!
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?
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”.
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”
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.
@Rich Thanks for your guidance and such a good explanation …
I found this article that @steve made very detailed too …
[Add any number of rows from any row within a table](https://community.appsheet.com/t/add-any-number-of-rows-from-any-row-within-a-table/22869) Tips & Tricks ?
Definitely a frequently-asked question: how do I add some number of rows to a table automatically? It’s possible, but it’s not easy. This article details an approach that can be accomplished entirely within AppSheet (no API use), within the app itself (no workflow use), and accommodates an arbitrary number of rows (no built-in count maximum). While I’ve tried to make the guide accessible for less-experienced app creators, make no mistake: this is an advanced technique. I hope you find this us…
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 …
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 …
the ACTION “” for each row to add do this … "will not be needed, delete it …
On form, i save just trigger the “Add more rows" … action ”
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
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!