I have an idea where I want a table to store a list of annual recurring events and the associated races. When a new 'Year' record is created I want to automate the initialisation process for that year by using that list of recurring events to create the related events records in that new year.
I thought that it might be possible to pass the new Year record to a function from the Bot Trigger when the new Year is created, but that seem not to be the case as only columns seem to work.
Is there another way to achieve the same result? e.g. pass the Row_ID and use it to get the table data?
I've done this in Django, but wanted to explore AppSheet as a simpler implementation for others to maintain.
Thanks,
@PhilDavies wrote:
I thought that it might be possible to pass the new Year record to a function from the Bot Trigger when the new Year is created, but that seem not to be the case as only columns seem to work.
I am not sure what you mean by "as only columns seem to work"? What is the new year creation?
As I understand your need, you have a recurring list of race events that, at the start of each year, you want to pre-populate into the year's schedule. Correct?
Short answer is Yes, you can have a template table that provides the basic event details to use as a source record. The challenging part will be assigning the Dates of the events since those dates will likely be different year over year. Some you can automate if you know how the Dates are derived - e.g. over a certain holiday weekend. Others you will need to manually fill in.
The process you build is mostly a standalone - set of functions to copy rows and insert year specific details. I would think you only need the year to insert into the event rows.
It sounds like you have something that creates a new year row. If so, there would NOT need to be any specific trigger criteria. Just check the "Adds" data change type and set the "Condition" area to true.
Now, the table you use to trigger the Bot is NOT the same as your copy process. The actions in your process will need to based on your template table. You will need a "transition" action to switch context to your template table - i.e. an action of type "Data: execute and action on a set of rows". The set of reference rows will be the event rows from the template table. The Referenced action would be of type "add a new row to another table using values from this row"
Now, the final piece is that you need to be able to grab the correct Year value. You can do that in 1 of 3 ways:
1) Assume that the current year is the year you need and grab it from the TODAY() function.
2) Grab the year from the MAXROW in your "Year table". This would be needed if you were schedule the events a year or two in advance, for example.
3) Use the Year from the year row that triggered the Bot. for this you will need the INPUT() function. Use it in the Referenced action mentioned above and the "transition" action should automatically provide a variable to supply the year value. Tap the link above for more details.
I hope this helps!!
User | Count |
---|---|
16 | |
7 | |
6 | |
5 | |
3 |