Using Regex for Flow Designer Action script output

Justin N
Tera Contributor

I am trying to create a reusable flow designer action to regex a string and return the output if the string is found. When I perform manual testing on the action I get a result in my actionOut variable.  When I test against the actual flow executing, it returns nothing.

 

A couple of point for clarification:

  • Both the flow and subflow are published
  • I have validated that the string values are properly being brought in as inputs to the subflow.

Action Script:

(function execute(inputs, outputs) {
    var regexSearchInput = inputs.regexSearchInput;
    var caseSensitive = inputs.caseSensitive;
    var str = inputs.str;
    var regexSearchI = new RegExp(regexSearchInput, "gi");
    var regexSearchS = new RegExp(regexSearchInput, "g");

    // write the output of the variable
    if (caseSensitive == "false") {
        outputs.regexsearchout = str.match(regexSearchI)[0];
        }
    if (caseSensitive == "true") {
        outputs.regexsearchout = str.match(regexSearchS)[0];
        }
})(inputs, outputs);
3 REPLIES 3

Saurabh Gupta
Kilo Patron
Kilo Patron

Hi,
did you map the output variable of JavaScript step to the output of action?

 


Thanks and Regards,

Saurabh Gupta

Yes - I believe that both the script output and the action output are set up correctly. I have attached a screenshot of the output step mapping.

 

Although I don't believe this is the issue, I appreciate the fast response!

Saurabh Gupta
Kilo Patron
Kilo Patron

Hi,
Can you please apply the gs.info in the JavaScript step and run the flow and check the logs.
Check the inputs in the gs.info as well.



Thanks and Regards,

Saurabh Gupta