Action "Data: add a new row to another table using values from this row" with additional user input

I am using the Occupancy Tracker template to create an App to track activity use at a Scouts event. Each activity will be an ‘Area’ per the template model. I thought to update the ‘Add person’ Behaviour (see image) to prompt the user to scan an NFC TAG (whilst also retaining the actions it already performs).

The action sequence would be: User clicks +; user prompted to enter/scan TAG; app writes AREA, OCCUPANCY, LOGGED BY as defined by the existing expressions; and, the new TAG.

An additional column on the ‘Occupancy log’ table will hold the TAG number.

I hope there is a way to do this with an expression, but don’t have the experience with AppSheet to work out how. Any / all help is appreciated!

If understanding of your requirement is clear, there could be a couple of options to achieve the needful.

One option is to add a LINKTOROW() action to the newly added row that you have added in the action your have described. You may need some additional logic to ensure that the newly added row of the current user is referenced by the action. You could do this by having an [Email] column in the Occupancy Log" table that captures the email of the user who added the row.

The LINLTOROW() could point to the newly added row in the “Occupancy Log” table and take the user to a form based on the “Occupancy Table”. In this form you can have only NFC tag field to scan and save to the newly created row.

You can then group the two actions 1) Add new row followed by 2) LINKTOROW() action in another group action. You can set the first two actions as do not display and display only the group action.

App column type (deep link) - AppSheet Help

https://support.google.com/appsheet/answer/10106539?hl=en&sjid=9401137221184941734-AP

Actions: The Essentials - AppSheet Help

Thank you for such a fast reply. I am very new to Appsheet and can’t wrap my head around how to properly implement what you’ve suggested.

I have created a new form “Occupancy TAG_Form” on Data: Occupancy Log. This shows only the TAG field I’ve added to the Occupancy Log data.

I understand the theory of grouping actions, but I can’t understand how (or where?) to properly create the LINKTOROW action. Are there any worked demo’s you know of that use this approach that I could learn from?

Apologies for such newbie questions. I’ve tried self-help in this community but struggling. All help is appreciated. Kind regards. In the meantime, I will keep trying to resolve this myself with your original reply as guidance. Guy

You need not apologise at all. We all have learning curves and each one of us has been through that journey with any new product. Also it is very appreciable that you are trying things at your end before approaching the community.

The suggested approach is as below:

Please add a column called say [Added_By] in the “Occupancy Log” table. The column needs to be of “Email” type with initial value as USEREMAIL(). This will capture the email of the user who added the record to the table.

Your second LINKKTOROW() action can be of type “Go to another view within this app” and the action’s expression can be something like

LINKTOROW(MAXROW(“Occupancy Log” , “_ROWNUMBER”, [Added_By]=USEREMAIL()), “OccupancyLogNFC_Form”)

Let us say the name of this action is “Capture NFC Tag”

Here the “OccupancyLogNFC_Form” is a form on the “Occupancy Log” table with a single column where you wish to scan /capture the NFC tag.

Please have the prominence of both the actions “Add Person” and “Capture NFC Tag” as “do not display”

Now create a third action called say “Add Person n Tag” of type “Grouped: execute a sequence of actions” with the following constituent actions

Add Person

Capture NFC Tag

Please note the order of the constituent actions is important for execution sequence. Please have the prominence of this “Add Person n Tag” action as “Display prominently”

Now when the user executes this group action , first a record is added to the “Occupancy Log” table and then a form opens for the user to add the "NFC " tag field.

Hope this helps.

Edit: Made one error correction in the action name quoted.

Reference articles: MAXROW() - AppSheet Help

Limit users to their own data - AppSheet Help

Simply, WOW.

That was great and I’ve now started to see how the different parts hang together in a way I’d not understood before. I do know I would not have reached this solution on my own, so you have my appreciation for your patient help!

All the best.

1 Like

You are welcome. Good to know that the approach works per your requirement. All the best with your app building.