Flow designer if condition help

RudhraKAM
Tera Guru

Hello There 

 

I have a requirement where the flow is triggered ,when the RITM is created , in a section we need to check if the user provided value in a string variable is "Pedcs" or "Rad Onco" we have 200 like this , what is the best way to add these , so that we can maintain

6 REPLIES 6

Amit Gujarathi
Giga Sage
Giga Sage

HI @RudhraKAM ,
I trust you are doing great.
To achive this you can create a custom action in which the variable will be one input .

You can store all the keywords as comma seperated in the system property .

In custom action script get the value of system property and split it will "," to generate the array for the same.
Then check if the variable present as a part of that array or not , if yes return true else false.
sample code :

// Define the keywordString and input variables
var keywordString = 'Pedcs,Rad Onco,abc';
var input = 'Rad Onco';

// Split the keywordString into an array
var keywords = keywordString.split(',');

// Find the index of the input variable within the array
var index = keywords.indexOf(input);

// Check if the input variable was found in the array
if (index !== -1) {
  console.log('The input variable was found at index', index);
} else {
  console.log('The input variable was not found in the array');
}

Was this answer helpful?


Please consider marking it correct or helpful.


Your feedback helps us improve!


Thank you!


Regards,


Amit Gujrathi



@Amit Gujarathi  Can you please help me with step by step process , I am new to this flow designer 

 

I created a property 

RudhraKAM_0-1687525224904.png

 

Created a Custom action ( not sure if i am doing this in correct way ) 

Input value I mentioned is the variable name from the flow

RudhraKAM_0-1687525970231.png

 

what should i do next ?

 

Ahmmed Ali
Mega Sage

Hello @RudhraKAM 

 

One approach would be to create a custom table with one record for each value. Then in your flow query that table and for each record i that table, have if condition defined to check with variable value.

 

You can do it with script as well, but the table approach would be clean one to future value addition/removal.

 

Thanks,

Ali

 

If I could help you with your Query then, please hit the Thumb Icon and mark my answer as Correct!!

Thank you,
Ali

RudhraKAM
Tera Guru

Thanks @Ahmmed Ali - @Amit Gujarathi 

 

If I want to add that in the flow condition itself , is it ',' separated ?

RudhraKAM_0-1687353321504.png