I have a “Tasks” table, where each task has multiple sub-tasks stored in a separate table. The sub-tasks are linked to tasks using the task’s RowID.
I automated the creation of tasks each day, but how can I also create the related sub-tasks automatically and link them to the newly created tasks RowID?
When you loop through the Tasks table, you should be able to retrieve the task ID.
Add a loop through the Sub-tasks table, filtering by Task ID is equal to the “Looped Task” ID.
Then, add rows to the Sub-tasks table, using the “Newly created Task” ID.
Is that what you want to do? Like duplicating the package of tasks & sub-tasks?
But how can I retrieve the task RowID of newly created task? I want to be able to create a new task at a certain interval which I already managed, but I am stuck with creating the sub-tasks and link them through the RowID of newly created Tasks
This is what my database looks like:
Tasks Table:
Sub-Tasks:
Isn’t there an option to retrieve the new RowID? Not sure how that works with scheduled workflows and loops, but it’s there for user initiated workflows.
Unfortunately that option isn’t there with backend workflows.
The way I’ve handled this situation is as follows:
- Create the parent row with a normal add row action via a user initiated workflow
- Write the parent RowID to a User Specific column
- Feed that into a series of JSON columns that define add row mutations for the child rows
- Back in the user initiated workflow, wait until the parent RowID is not empty, then send the JSON body to a webhook triggered workflow, which in turn calls the Glide API to add the child rows.
Not sure if the above approach will work for Hassan, as I understand he wants the whole thing to run on a schedule.
1 Like