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
almost 7 years 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
almost 7 years 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.
1 person likes this
a
alberto.cogliati@docebo.com
said
almost 4 years ago
Hello, here we have the same need. We need append a list of items to another list of items (list of same objects). Do we have to use the same trick or we have a better solution?
Amanda Wong
said
almost 4 years ago
Hi Alberto,
This thread is pretty old. We have since added new Lists functionality with Variables by Workato connector which allows you to create a list and add item to the list at any step in the recipe. Check it out here:
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
alberto.cogliati@docebo.com
Hello, here we have the same need. We need append a list of items to another list of items (list of same objects). Do we have to use the same trick or we have a better solution?
Amanda Wong
Hi Alberto,
This thread is pretty old. We have since added new Lists functionality with Variables by Workato connector which allows you to create a list and add item to the list at any step in the recipe. Check it out here:
https://docs.workato.com/features/variables.html#create-list
https://docs.workato.com/features/variables.html#add-item-to-list