How can I append to an existing Workato List and use the List in other steps?
Hi, I am currently trying to create a recipe in which I have items that from separate actions, which are not within the same for loop, which I would like to append to one Workato list. I understand that the `Append to existing List` action only works within a `Repeat action` and not across different un-nested `Repeat actions`.
For a better understanding of what I am trying to do, please see the screenshot below. Essentially, I would like the `Append item to list` action in Steps 3 and 5 to append to the same list which I can use in follow up actions.
Best Answer
B
Bryan Yap
said
about 1 year ago
Hi Saul,
Yes, it is definitely possible to do this. However, you won't be able to do it using the native List connector in Workato. You will need to make use of both the Logger and Ruby connectors.
Create empty list within a `Log message` action using the `Logger` connector. You may do so by using formula mode and specifying `[]` within the `Message` field. Essentially, `[]` represents an empty array in Workato.
Append item to list via `Logger message` action, using the `<<` symbol to represent the operation of appending.
Use the `Execute code` action of the Ruby connector to extract the list from within the `Message` datapill of the Logger connector. You will need to specify the output schema of this step and make sure that it matches the object which you appending the list in the prior step.
Use the list output of the Ruby connector action for your follow up actions.
Answer
Bryan Yap
said
about 1 year ago
Hi Saul,
Yes, it is definitely possible to do this. However, you won't be able to do it using the native List connector in Workato. You will need to make use of both the Logger and Ruby connectors.
Create empty list within a `Log message` action using the `Logger` connector. You may do so by using formula mode and specifying `[]` within the `Message` field. Essentially, `[]` represents an empty array in Workato.
Append item to list via `Logger message` action, using the `<<` symbol to represent the operation of appending.
Use the `Execute code` action of the Ruby connector to extract the list from within the `Message` datapill of the Logger connector. You will need to specify the output schema of this step and make sure that it matches the object which you appending the list in the prior step.
Use the list output of the Ruby connector action for your follow up actions.
Saul Macht
How can I append to an existing Workato List and use the List in other steps?
Hi, I am currently trying to create a recipe in which I have items that from separate actions, which are not within the same for loop, which I would like to append to one Workato list. I understand that the `Append to existing List` action only works within a `Repeat action` and not across different un-nested `Repeat actions`.
For a better understanding of what I am trying to do, please see the screenshot below. Essentially, I would like the `Append item to list` action in Steps 3 and 5 to append to the same list which I can use in follow up actions.
Hi Saul,
Yes, it is definitely possible to do this. However, you won't be able to do it using the native List connector in Workato. You will need to make use of both the Logger and Ruby connectors.
I have created a recipe to show how this can be done at https://www.workato.com/recipes/641504-append-and-extract-items-from-list-within-logger-datapill#recipe.
Here are the main steps of the recipe:
Bryan Yap
Hi Saul,
Yes, it is definitely possible to do this. However, you won't be able to do it using the native List connector in Workato. You will need to make use of both the Logger and Ruby connectors.
I have created a recipe to show how this can be done at https://www.workato.com/recipes/641504-append-and-extract-items-from-list-within-logger-datapill#recipe.
Here are the main steps of the recipe:
1 person likes this