list collector variable in flow designer
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-09-2024 01:28 AM
Hello, Can anyone please help on the below requirement. I have one list collector variable which is referring to user table. I need to give the condtion in flow designer is if that list collector variable does not any value then task will not get create if it contains value task will get create.I have directly like variable is not empty but it is not working. Can anyone please help me how to give the condition in flow designer.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-09-2024 01:51 AM
Hi @Mansi roy,
Can you share some screenshots of your Flow?
And what do you mean by it's not working?
Cheers
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-09-2024 02:29 AM
Hello @Mansi roy ,
Check by adding script action to check the value present in that list collector variable or it is empty:
Action script example(update it as per your req.):
(function execute(inputs, outputs) {
// Get the list collector variable value
var listCollectorValue = inputs.listCollectorVariable;
// Check if the list collector is empty
if (listCollectorValue && listCollectorValue.trim() !== '') {
// List collector has values
outputs.taskShouldBeCreated = true;
} else {
// List collector is empty
outputs.taskShouldBeCreated = false;
}
})(inputs, outputs);
Define an input for the script action to accept the list collector variable value and Define an output to store the result of the condition check (taskShouldBeCreated).
After the script action, add a "Decision" step. Use the output from the script action (taskShouldBeCreated) to decide whether to create the task or not.
In the decision step, create two branches: One for when taskShouldBeCreated is true (create the task). Another for when taskShouldBeCreated is false (do not create the task).
Thank you!!
Dnyaneshwaree Satpute
Tera Guru