Forum Academy Marketplace Showcase Pricing Features

Passing single item to list/array in workflow key

Hi all,

I’m having trouble passing a single item into a ‘list/array’ key when scheduling an API workflow.

The set up…

I have an API workflow (update_tutorial_rewards) where I can pass a list/array of user_rewards

However, when I a try to schedule the API workflow (update_tutorial_rewards), it wont allow me to pass a single user_reward.

My understanding was if you had a list/array, you could have >=1 item in that list/array. However, this is acting like you HAVE to pass >1 item to the list/array.

Question: Is my understanding incorrect and you have to pass >1 item to the key (that is a list/array) when you schedule and API workflow?

** UPDATE: there are actually two solutions: see post #5 if you are using text or number data type and post #2 if using a data type listed in database.

Hi @andrewmccalister :wave:

I think you need to use :converted to list when there is single item…

Did you try :converted to list option…

Operators & Comparisons - Bubble Docs…-converted-to-list

1 Like

hey @viquarahmed07 ,

That seems to have done it.

I knew there must be a simple solution I was completely missing.

1 Like

Interestingly, worked perfectly for the original issue (converting a single data type item into a list of data type items).

However, it doesn’t seem to work when the data type is text or number, there is simply not an option ‘:converted to list’ for either of the text or number data type.

If it is text, you can simply add an ‘arbitrary text’ do something like this within it:
Contents of Arbitrary Text: MyText,
Dynamic Data looks like this: Arbitrary text: split by(,)

This will convert your text into a list with 1 item.

For numbers you can do the same and then convert the list to numbers.
It will look like this:
Arbitrary text :split by(,) :converted to number
Contents of Arbitrary Text: 1,2,3,4,5
This will give you this list of numbers

1 Like