We are celebrating the 10-year anniversary of the Alteryx Community! Learn more and join in on the fun here.
Start Free Trial

Alteryx Designer Desktop Discussions

Find answers, ask questions, and share expertise about Alteryx Designer Desktop and Intelligence Suite.
SOLVED

Pass a field value to the Regex Tool in an app

warrencowan
9 - Comet

Hi All,

 

I am building an analytic app which has a series of 3 regex tools performing different routines eg a tokenise to rows, pase this, split that etc.

 

I have the statements for these tools in a series of seperate customer specific external settings files (Not an app values settings file) and bring them into the flow as an input subject to the customer we're running the app for.

 

But the regex tool only seems to accept values directly or passed via an action tool. Try as a I might, I can't find a way to pass the values Ive imported into the flow to the tool.

 

I originally tried to isolate the individual fields with the regex statements into their own streams, so I could move the values to the column header and pass them as single values to drop downs via the connected tool option. But this failed because when I change the customer's settings that I wnat to pull in the values for, the drop downs dont refresh to the new imporeted values, unless I rerun the workflow and resave the app, which sort of defeats the object really.

 

Does anyone know a better way to solve this.

 

thanks in advance

 

w

16 REPLIES 16
Dazzerman
11 - Bolide

Hi again,

 

From what you have said so far, you may not need a macro at all.  This REGEX will match the codes that you have specified :

\w+\d{3}

You can use that regex pattern with a Regex_match function in a filter, or use it in a Parse to tokenize the data if that suits what you want to achieve better.

Nandakishore
8 - Asteroid

Hi @Dazzerman ,

 

That was just an example . Actually i have more than 15 patterns before the string gets matched and i do not want to use filter . 

 

Thanks.

Dazzerman
11 - Bolide

So are you saying that you have a table of strings that you want to test against 15 or more regex patterns, and you want to identify the strings that match all 15 regex patterns?

 

If that is not what you're trying to achieve, then I would need to to explain in more detail what you want, ideally with a set of possible strings and patterns you're trying to match against.  Understandably you won't want to share any client sensitive data, but if you create an example set that isn't sensitive or protected then that would help a lot.

Nandakishore
8 - Asteroid

So are you saying that you have a table of strings that you want to test against 15 or more regex patterns, and you want to identify the strings that match all 15 regex patterns?

 

Correct :)

Dazzerman
11 - Bolide

OK, based on what you have said, the attached workflows seem to do what you want.

 

As is often the case, there are likely other ways it could be done, but this I was able to do fairly quickly.

Nandakishore
8 - Asteroid

Hi @Dazzerman ,

 

Thanks for the info . But in case i need to pass another expression during wf execution how do i do that . 

 

 

Dazzerman
11 - Bolide

You just have to amend the contents of the upper Text Input with the Regex you want as your selection criteria.

 

So in this case, the only sentence that matches all 3 regex expressions :

t.e

o{2}

j.*d

 

... is "The cow jumped over the moon".

 

Dubya_results.jpg

Labels
Top Solution Authors