Alteryx Designer Desktop Discussions

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

Regex Parse Expression Not Updating with Listbox and Action Tool for Macro

tstowell
7 - Meteor

I don't know if anyone has ever run into a problem like this. I have tried every different configuration of the listbox by manually inputing my names and values or doing it in an external input (excel sheet). Whatever I do the value won't update in the regex parse expression when I run my macro. It just reverts to the default value that was in there when the macro was configured. If anyone can help I would appreciate it. Thanks!

 

tstowell_0-1652573008486.pngtstowell_1-1652573040250.png

 

tstowell_2-1652573057615.png

 

16 REPLIES 16
DataNath
17 - Castor

For the manual input, the options should be on individual lines like so:

 

If you wanted to display the following as plain text for the user, with the correct values working behind the scenes then it'd be:

One:1

Two:2

Three:3

 

With NO spaces between the colon when setting up in 'Name:Value' format.

 

DataNath_0-1652574676606.png

 

If using an external sheet, have you ensured it's in the following format (i.e. has name & value headers)?

 

DataNath_1-1652574891831.png

 

tstowell
7 - Meteor

Hi @DataNath @Thanks for replying! My names and values for my drop down list are fine. The problem is trying to update the marked fields for the regex parse. The original macro had one marked field as RegExOut1 and then the list trying to update it has 29 marked fields. Does that make sense?

DataNath
17 - Castor

No problem @tstowell! In your second screenshot, where you are using a manual list, you haven't split them onto individual lines. Therefore, when you select to use that option, it is replacing the RegEx marked expression with that massive string of text after 'Tiger:' and therefore giving all 29 capture groups at once. If you split each onto a single line then it should work fine i.e:

 

(.{5})

(.{2})

(.{17})

(.{2})

 

On a separate note. From looking through your screenshot, it seems you have a lot of the same capture groups. Unless I'm missing something?

tstowell
7 - Meteor

@DataNath I'm trying to split an entire fixed width txt file that comes in one column. I need all 29 capture groups to fall under one Name. That is why I did the name "Tiger" than the whole expression for the value. Can I put each one on a seperate line and have it fall under one name?

tstowell
7 - Meteor

I need to somehow update the number of marked expressions to be the number with the expression coming in. Ex: (.+) is 1 marked field and my data coming in, (.{5})(.{2})(.{17})(.{2})(.{12})(.{11})(.{5})(.{9})(.{9})(.{6})(.{4})(.{60})(.{10})(.{5})(.{5})(.{12})(.{2})(.{10})(.{5})(.{11})(.{1})(.{26})(.{11})(.{11})(.{11})(.{11})(.{12})(.{12})(.{2}) is 29 marked fields.

DataNath
17 - Castor

I'm guessing you need this to be dynamic as you'll have other words in the dropdown with different expressions/# of capture groups? Or have you just acquired a macro that you're trying to change the RegEx expression for? If it's the former, I've been having a look around and can't seem to find a way of dynamically doing this.

tstowell
7 - Meteor

Yeah! It needs to be dynamic. I'm glad I'm not going crazy, I've tried everything. I will keep trying things, but thank you for responding!

DataNath
17 - Castor

Thought as much! Are you able to provide more context? Perhaps a couple of the options that you'd like in the dropdown (in terms of the input and expressions/what needs capturing) and what the desired outcomes are? Can then try and figure out a fix (though this one seems a bit tricky!)

DataNath
17 - Castor

@tstowell just had a re-read of your earlier messages about needing it under one column and think I've identified the real issue here - the RegEx itself. The reason Alteryx is trying to break it up into 29 is because you have the 29 lots of (). I think we need to re-look at your expression as it doesn't really make sense, especially if you really do just want it in a single column. Let's just take your first 3 capture groups for example; (.{5})(.{2})(.{17}). With the use of the wildcard (a full-stop in RegEx), you're not being specific on any level so these groups alongside each other are telling Alteryx to return the first 5 of ANY characters, then the next 2 then the next 17. In a string containing 'I love data, it's the best' this would literally return (I lov)(e )(data, it's the be), which wouldn't be an issue if you wanted them split up into multiple columns, but consolidating them under 1 would literally just return the original string (as shown below, with a single capture group), in order, as it was. Again, if you can provide a couple of example inputs/desired outcomes we can revisit!

 

DataNath_0-1652581889147.pngDataNath_1-1652581896608.pngDataNath_2-1652581938464.png

 

Labels