Workflow - Issue with 'Get Index' Operator in Define Variable Operator

Hi,

I am not sure if you have used or tested the ‘Get Index’ operator within the Define Variable operator in a workflow. I have tested this in a workflow but it always returns “0” value regardless you have put anything in the pattern field.

For example, if I set the Get Index (pattern) field to double backslashes (i.e \\) or any other substring (i.e text or integer), it always return “0” value and doesn’t find the location of that specific substring in step’s input as expected.

Any idea what value should we set in the Get Index - pattern field to return the location of double backslashes (\\) in the input string and then using the Substring operator to return the text from there?

Thanks

I just found, Angelo has already created a post for this issue Define Variable - Get Index always returns 0

1 Like

Hey @nhassan,

I dug into this and found the issue regarding the getIndex operation.

The UI does not generate the correct JSON for getIndex, the key for where the pattern is stored is generated as patternGetIndex. Changing this key in the advanced editor tab to Pattern will give you a valid index given that the regex is correct.

I am going to create a bug ticket to get this resolved, but for now you can use this as a workaround.

Hi @tyler_mairose

Thanks very much for your help.

I changed the JSON for getIndex to Pattern in the advanced editor tab as you have mentioned and now it seems to be returning a valid index. :+1:

This topic was automatically closed 60 days after the last reply. New replies are no longer allowed.