Hi there ! I am starting using Appsheet and i get stuck while trying to create an action that adds multiple rows at once. Let me detailed my issue :
I have a Table A where I have a [start date] and an [end date] that gives me a [duration] in number (eg : 7 days)
I have a Table B where I list events with a [date] column
Note that Table A and Table B are linked with a [Patient] column
What I am trying to achieve is the following: When a user submit a form for Table A with n as a duration, I want to add n rows in the Table B with the date column incrementing itself adding +1 to the day of the [date] column until [End Date] from Table A is reached.
I am obviously open to changes in my data structure to make it work . I Have been searching for a while and couldnโt manage to do itโฆ
I hope I made myself clear as I am a non native english speaker.
Thanks you for your help.
Solved! Go to Solution.
Workflows can be used to loop for n number of days, when you have a table with all the possible dates (Table C). After user enters a start & end date - use a webhook workflow to run the Add action in Table B by selecting the dates in range from Table C.
{
"Action": "Add",
"Rows": [
<<Start:SELECT(Table C[Date],AND([Date] > [Start date], [Date] < [End date]))>>
{
"ID": "<<UNIQUEID()>>",
"Date": "<<[Date]>>"
},
<<End>>
]
}
User | Count |
---|---|
43 | |
29 | |
29 | |
14 | |
14 |