cancel
Showing results for 
Search instead for 
Did you mean: 

Triggering another recipe

jarh15
Deputy Chef I
Deputy Chef I

Hi, 

I have the following workflow:

  1. User triggers recipe from workbot in slack by typing "create data"
  2. Slack workbot sends link to google sheet for user to fill out
  3. Once that google sheet is filled out, I need another recipe to be triggered, using the data that was entered into the google sheet by the user. 

I'm struggling with 2 things: 

  1. How do I reference data from the first recipe in the second recipe?
  2. How do I make sure the user is fully done with filling out the sheet rather than just triggering when the user fills out only one row? The user needs to fill out multiple rows of the google sheet and I only see a trigger for when a new single row is entered in a sheet.

Thanks for any advice!

1 ACCEPTED SOLUTION

gary1
Executive Chef III
Executive Chef III

I ask because your second recipe needs to be triggered by an update to a Google sheet, which can only be configured by identifying the sheet by name or ID. If you're making a new sheet every time, then it's going to be really difficult to listen to an update on every individual sheet you create. (I'm not even sure if it can be done natively.)

There's also a lot of connective data needed to bridge the two recipes asynchronously. In short, Recipe 1 needs to leave an ID in the gsheet, and recipe 2 needs to use that ID to retrieve data from elsewhere.

Here's a more detailed breakdown:

  1. User sends Slack message and triggers Recipe 1
  2. Recipe 1 does a few things:
    1. Stores all details you need for recipe 2 somewhere (a lookup table, or even another gsheet). This data needs to be associated to an ID, so let's just call it "data ID"
    2. Updates the user gsheet with the data ID. It should be put in the same cell of each row the User needs to fill out. It could be hidden, it could be the same color as the background, but it's gotta be there 
    3. Sends the link to the user gsheet back to the User via Slack
  3. The User fills out the data in the gsheet, and when they are finished there is a field with a dropdown that they must change to "Submit". This will allow you to conditionally trigger Recipe 2 when the user says they are done entering data. There's a lot of nuance here, but I'm not getting more into the weeds. (The data ID must be on the same row as this field to work with the Workato  action trigger.)
  4. Recipe 2 triggers when the user updates the specific cell to "Submit" and pulls in the row. It gets the data ID that is present the same row. It uses the data ID to lookup the Recipe 1 data. Then it gets all rows from the gsheet that contain the same data ID (i.e., the multiple rows that the user filled out, all having the same data ID).
  5. At this point, you're in Recipe 2 with Recipe 1's data and all of the rows needed from the gsheet.

Hope this helps!

View solution in original post

3 REPLIES 3

gary1
Executive Chef III
Executive Chef III

I have a question: Is a new Google sheet created for user each request, or is the same Google sheet for each request (the user adds data to a specific row in the sheet per request)? 

It would ideally be a new sheet for each request, but if need be it can be the same Google sheet. Why do you ask?

gary1
Executive Chef III
Executive Chef III

I ask because your second recipe needs to be triggered by an update to a Google sheet, which can only be configured by identifying the sheet by name or ID. If you're making a new sheet every time, then it's going to be really difficult to listen to an update on every individual sheet you create. (I'm not even sure if it can be done natively.)

There's also a lot of connective data needed to bridge the two recipes asynchronously. In short, Recipe 1 needs to leave an ID in the gsheet, and recipe 2 needs to use that ID to retrieve data from elsewhere.

Here's a more detailed breakdown:

  1. User sends Slack message and triggers Recipe 1
  2. Recipe 1 does a few things:
    1. Stores all details you need for recipe 2 somewhere (a lookup table, or even another gsheet). This data needs to be associated to an ID, so let's just call it "data ID"
    2. Updates the user gsheet with the data ID. It should be put in the same cell of each row the User needs to fill out. It could be hidden, it could be the same color as the background, but it's gotta be there 
    3. Sends the link to the user gsheet back to the User via Slack
  3. The User fills out the data in the gsheet, and when they are finished there is a field with a dropdown that they must change to "Submit". This will allow you to conditionally trigger Recipe 2 when the user says they are done entering data. There's a lot of nuance here, but I'm not getting more into the weeds. (The data ID must be on the same row as this field to work with the Workato  action trigger.)
  4. Recipe 2 triggers when the user updates the specific cell to "Submit" and pulls in the row. It gets the data ID that is present the same row. It uses the data ID to lookup the Recipe 1 data. Then it gets all rows from the gsheet that contain the same data ID (i.e., the multiple rows that the user filled out, all having the same data ID).
  5. At this point, you're in Recipe 2 with Recipe 1's data and all of the rows needed from the gsheet.

Hope this helps!