The app is to help run sessions, where each session has a number of members attending, each member with a specific role/duty.
For this, I have a โSessionโ table which will holds set of dates for each session held or scheduled.
The set of possible roles that members would perform are defined in a โRoleโ table.
e.g.
Speaker1
Speaker2
etc
The technical problem is figuring out how to populate a third table โSessionRolesโ automatically when a new Session is scheduled i.e. record is created. SessionRoles is roughly a union of the two tables with key fields SessionDate and Role, each field coming from the two tables.
What I would like is when adminstrator creates a new Session record, system has to automatically create new records in SessionRoles for that new Session date. In the example above, if a session record for 03/15/2019 is created, I would like to have SessionRole to have 2 new records created, one for each role in the Role table
03/15/2019 Speaker1
03/15/2019 Speaker2
Possible?
Not currently possible from within the app itself.
@Mahesh
You can do it with using AppSheet API and creating a webhook workflow rule for ADDS on your Session table. You can read below page for further info:
https://help.appsheet.com/integrations/api/adding-records-to-a-table
Thanks @LeventK.
Using the API is defintely a very intriguing idea. I did stumble upon this page previously but could not figure out how to make it work for me.
So in my case add on table1 will trigger copy of all records in table2 to be copied to table3 plus including one column value from table1. Since the API payload is dynamic (versus hard coding the payload like in the sample), I was not sure how to construct the payload for such an API call.
Thoughts?
Thanks in advance.
@Mahesh
Constructing the payload is easy as explained in detail on the page I have referenced. Letโs assume that you have constructed a webhook workflow for Table1 / ADDS_ONLY and your intention is to record some rows in Table2:
Firstly, you need to turn on the REST API from Manage > Integrations > IN: from cloud services to your app
This payload will create 2 records in Table2 and for each column you specify in Table2, it will record the value of the current row/record values of the Columns you have specified in Table1.
@LeventK, Is it possible to use START: and END to add โnโ number of rows?
@Fernando_Lopez
I believe itโs possible
@Fernando_Lopez, what do you mean by โSTARTโ and โENDโ. I do not see anything like in API sample here
I think you can use START: and END to iterate over a LIST or a SELECT, just like a report TEMPLATE. Check the documentstion about templates on reports.
@Fernando_Lopez, I am interested in learning how it works out for you. Please do post your experience with using Start/End
@LeventK, In the sample you have actually entered each row with each column value which of course makes sense in that example.
But I do not see how this will work when I have a dynamic number of rows in my table and I need copy each one of them into another table. One would need some construct which would iterate over each row and build the payload like you showed, and I do not know how one would achieve that part.
.
See this article which explains how to invoke the API from a webhook. It contains an example JSON template that includes Start and End.
User | Count |
---|---|
43 | |
32 | |
25 | |
23 | |
14 |