• DOCUMENTATION
  • WORKATO BLOG
  • PRODUCT BLOG
  • Return to Workato
  • Log in
  • ☰
  • Solutions Articles
  • Forums/Discussions
  • Submitted Tickets
New Topic
Discussions Recipe Building Recipe Building Questions
S

Saul Macht

started a topic about 3 years ago
Answered

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.

image


Best Answer
B
Bryan Yap said about 3 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.


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. 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.
  2. Append item to list via `Logger message` action, using the `<<` symbol to represent the operation of appending.
  3. 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.
  4. Use the list output of the Ruby connector action for your follow up actions.

Answer

Bryan Yap

said about 3 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.


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. 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.
  2. Append item to list via `Logger message` action, using the `<<` symbol to represent the operation of appending.
  3. 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.
  4. Use the list output of the Ruby connector action for your follow up actions.


1 person likes this
a

alberto.cogliati@docebo.com

said 25 days 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 24 days 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: 

https://docs.workato.com/features/variables.html#create-list
https://docs.workato.com/features/variables.html#add-item-to-list

Login to post a comment

Still can't find your solution?

Send us a ticket, we will try our best to assist you with your problem

Documentation
Developer's Library
Tutorials
eBooks
Product Hour
Product Blog
Workato Blog
Product updates
Customer Stories
© Workato 2020   Privacy   Terms   +1 (844) 469-6752
  • Documentation
  • Workato Blog
  • Product Blog
  • Solutions
  • Forums
  • Tickets
  • Log in
  • Return to Workato