Forum Academy Marketplace Showcase Pricing Features

Solution for adding multiple instances of one Thing into a list state

I couldn’t find any similar solution to this so I decided to share the solution I found on my own.

Problem
State (list) will not accept multiple instances of the same Thing.

Solution

  1. Instead of setting State Type to a Thing, set it to ‘text’.
  2. Create another State for iteration. We’ll name it Iteration with State Type: ‘number’
  3. Now when you want to add an item to your State (list), in ‘Arbitrary Text’ it should look something like this (without the “”):
    Thing’s unique ID**|**Iteration
  4. Add another action that will increment the value of Iteration

Now you can have multiple instances of a Thing in your State (list). When you need to retrieve that Thing from the State (list), use :Split By (we used the seperator | in this example) :first item, then just do a Search For using the “unique ID” as a constraint.

This is good if you don’t want to touch your database for temporarily storing multiple items. Hope this helps!

1 Like

Smart!

I just used the same thinking to ease the load of a multiple parallel recursive backend WFs that deals with incoming lists from an API. Instead of doing a “Schedule a workflow on a list” for each API response I simply add the API response to list of texts, adding a timestamp to the string. Then the whole list is stored in one quick action and it’s pretty easy to filter out the data in the frontend.

Best, Peter

1 Like