How to ignore case sensitivity in flow designer

Swetham
Tera Contributor

Hi all,

 

My requirement is as follows,

I have a set of 10 keywords.( eg, Password)

I have to check if any of the keywords is present in my interaction's short description and if so i've to create an incident.

 

This has to be done in flow designer and this must be case insensitive.

 

Could you please help me with inputs?

Thanks in advance!

4 REPLIES 4

Maik Skoddow
Tera Patron
Tera Patron

Hi @Swetham 

the easiest way is leveraging a toLowerCase() transform function in your data pills for both short description and keyword

MaikSkoddow_0-1693190541928.png

Maik

 

Harsimranjeet 1
Tera Expert

Hi @Swetham 

 

 

As Maik suggested, with toLowerCase() function, you will be able to achieve it.

 

Simran 

 

 

Community Alums
Not applicable

Hello Swetham,
As per your requirement, you can add a data pill after trigger that represents interactions short description. It will capture the short description
Then you can create a loop element of flow where in it will iterate through your list of keywords.
Create a list variables that contains 10 keywords, This list will serve as source of keywords,
Inside the loop add a condition where in it will check the case sensitivity of the short description 
Add condition where in if the keyword is found create an incident by adding an action 
Exit the loop to avoid the iteration 
End the flow and save and test

Please mark my answer as helpful, if it helped you in finding solution
Thanks,
Priyanka

ahmedkhan
Tera Contributor

Others have already mentioned using the flow designer data pill.
I've added a complete solution.
Works like this:
There is a flow, and an action to check the string match. The action can take any 2 string sets, comma separated also works, and returns true if there is a match. The flow calls the action. If there is match, it returns true.

I've attached the update set with the changes, should you need it. I'm also pasting the custom JS script used in the action below.

 

(function execute(inputs, outputs) {
  // Get the input string sets
  var firstSet = inputs.string1.toLowerCase();
  var secondSet = inputs.string2.toLowerCase();

  // Initialize the flag for intersection
  var intersection = false;

  // Split the comma-separated strings into arrays and trim each element
  var firstArray = firstSet.split(',');
  var secondArray = secondSet.split(',');

  // Loop through the arrays to find any intersection
  for (var i = 0; i < firstArray.length; i++) {
    for (var j = 0; j < secondArray.length; j++) {
      if (firstArray[i] === secondArray[j]) {
        intersection = true;
        break;
      }
    }
    if (intersection) {
      break;
    }
  }

  // Output the result
  outputs.intersection = intersection;

})(inputs, outputs);