cancel
Showing results for 
Search instead for 
Did you mean: 

Error on Choice Stage, cannot compare unknown

RicardoCabrera
Level 3
Hello I have a temporary collection that gets populated when the bot runs, it then goes to a choice stage and it follows the path depending on the values from that temporary collection, I don't want to predefine the fields on that temp collection as the users can add more columns to the source file at any given point in time, would you recomend using a decision stage instead of a choice stage, or any other suggestions? thanks in advance
2 REPLIES 2

david.l.morris
Level 15
If the users can add more columns but you do not intend to use the extra columns, I would say you should have 2 collections. Collection 1 would be undefined and takes whatever columns are received from the source file. Then take only the data out that you need by specifically referencing the column names and placing the data into your Collection 2, which has predefined columns.

Dave Morris, 3Ci at Southern Company

Pranitha_Durgam
Level 3

Hello @RicardoCabrera 

As we know, a decision stage is for evaluating single condition which results in true or false. And a choice stage meant to use when there are multiple conditions (works like switch-case).

If you want to replace a choice stage with a single decision stage, it can done with using logical operands (AND, OR) between those conditions as required only if the conditions are dependent like [fieldA] > 50 AND [fieldB] < 20.
But, if the conditions are independent on each other, i.e, [fieldA] < 50, [fieldA] >= 50 are two conditions which cannot be given in a single decision stage because both have their own routes. 

You can also go with multiple decision stages if the conditions are dependent on each other. But the recommended is to go with Choice stage, as it gives the output in one go.

And also using decision stage makes it unreadable with more conditions and multiple evaluations slow down execution.

I hope this is clear.