Hi All,
I'm working on a large dataset extracted from an API and I am unable to specify what fields are returned.
I have tried the Dynamic Select tool to only get back the fields I know I'll need in the database.
An example field is:
knownAssociates_1_dossierID
Tough there could be up to 99 of them with the 1 changing hence my alternative approach.
My dynamic tool expression is:
REGEX_Match([Name], 'knownAssociates\.*?\d{1,2}\.dossierID')
also tried:
REGEX_Match([Name], 'knownAssociates\d+dossierID')
also
REGEX_Match([Name], 'knownAssociates\d+dossierID')
The syntax is likely not right but I've tried various things and can't get it to work so I'd appreciate any input.
Thx
Solved! Go to Solution.
Hi @Lifesigns
If the fields are constant in that they always start with "knownAssociates" and end with "dossierID", then there are a number of ways you can go about this. If you want to use REGEX_Match, then you can modify the first formula you provided to look like this:
REGEX_Match([Name], 'knownAssociates.\d{1,2}.dossierID')
Incoming Data:
Output after Dynamic Select:
Cheers!
Phil
Thanks!
you're close but the match for
knownAssociates_1_dossierID
where the 1 can be any number is:
regexmatch([name],"knownAssociates_\d+_dossierID") - the second underscore is key to the match and missing from your try \d{1,2} will only grab a number from 0 to 99.
the \d+ means a number - any number of times. So if the file is knownAssociates_10101001_dossierID - it should still match.
If that doesn't work your naming convention is off and you should use a field info to look at your fieldnames and then see where your pattern goes wrong. In the alternative if you have see more changes with field info - you can drop the data source and output of the field names you want in the field info into a batch macro with the field info as the control and select the records/fields you want that way.