0

My problem is this: I'm using a collection variable to populate a count-variable, which in turn determines an outcome in a decision. If the collection variable has count greater than 1, i want the user to be prompted to pick between these objects. If the count is equal to 1, it has to be picked automatically.

My current solution works, but is not very elegant and hard to read; i have a record choice variable defined identically to the collection, which i refer to if the count is greater than one.

Ideally, i'd only have to store the objects in one collection variable and then use that if there's only one object in it, or pass it on to a selection screen if there are more.

Thanks in advance.

2 Answers 2

1

Sounds like the way you have this build is probably as efficient as it's going to get without over-engineering it.

The only other possibility I could think of is if you had a field that was doing the heavy lifting for you and aggregating the total number of records that would be in the collection variable therefore eliminating the necessity of the collection variable in the flow. In that case you can eliminate the collection variable and just have a record-choice set.

Not the answer you might have been looking for but your flow sounds solid!

0

I am sorry. I could not understand the difference between what you have and what you want very well. Can you explain further?

"My current solution works, but is not very elegant and hard to read; i have a record choice variable defined identically to the collection, which i refer to if the count is greater than one.

Ideally, i'd only have to store the objects in one collection variable and then use that if there's only one object in it, or pass it on to a selection screen if there are more."

Not the answer you're looking for? Browse other questions tagged or ask your own question.