Set a List from a series of Input's Values

Hello. I have a set of 5 inputs (type = Integer). These are part of user preferences, so I allow the user to set each integer.

These 5 values need to be stored in a field (type = Number) as a list.

Unfortunately, in the workflow where I want to set the list value to the series of numbers, I don’t seem to have the option :converted to list (so that I can use :plus item for the remaining input values).

How can I get a set of input values converted to a list? I’m not currently using a repeating group and prefer not to, but change to a RG if that’s the only way.

Thanks.

Turn on parenthesis or the new expression builder.

1 Like

I was already using the Beta feature Expression Parentheses. I tried your suggestion but it still does not give an option to convert the first item to a list so I can add additional list items.

You’re right… it looks like you can’t convert a number to a list that way…

So use Arbitrary text instead, and just create a comma separated text containing all the input values, then split it, and convert each item to a number.

You could add each input to the field list using add. This will call the back end 5 times though. Alternatively create a custom state list of numbers and add each value to that and then set the field in the back end to this custom state.

If the custom state is called numberList then…

numberList = numberList: Plus Item input value…

1 Like

Thanks. I have a custom state for the default values, but this is a user preference, so it needs to by dynamic.

I ended up first clearing the list, then adding each value one-by-one with a separate action just as you suggested. It’s sloppy, but I figure the user will experiment with the values a little bit and then probably not change the values again. So it shouldn’t be too much of a hit on the WU.

It just seems like I should be able to do this!

Thanks for the help.

Hi @ken1

The custom state is dynamic, not sure if we have wires crossed here…

Create the custom state on an element…

Set its value in a workflow on whatever action is relevant…
image

When done set list in your thing to the custom state…

image

Hope that helps.

Brian

1 Like

Ah, yes. I had meant I have an option set. You are suggesting to collect the values in a state as a list and then use that list. Perfect.

Thank you!

This topic was automatically closed after 70 days. New replies are no longer allowed.