Skip to main content
Nintex Community Menu Bar
Solved

Extract a word from comma separated combination.

  • Aug 10, 2023 2:10 AM UTC
  • 5 replies
  • 718 views
  • Translate All

Forum|alt.badge.img+3

I have a user's forename and surname in the combination ‘Surname, Forename’ and I’d like to:

  1. Reverse this combination to ‘Forename Surname’ while removing the comma.
  2. Extract just the Forename.

I’ve tried some regular expressions found in searching online but these either return an empty value or ‘false’. I have no previous experience in regular expressions. 

Any ideas?

Thank you. 

Best answer by feckinirish

No, though I’ve found an internal workaround.

View original

5 replies

Forum|alt.badge.img+6
  • Nintex Employee
  • Aug 10, 2023 4:26 AM UTC

Hello there.

I suggest you first try using split with the comma as delimiter (so don’t remove it) and save first / lastname as separate variables. you can set the comma as a delimiter by making it a variable (“set” or use the ascii command 44). You can then create a new variable that uses these found variables ($firstname$ $lastname$ in any order you set them in your new variable. Use a dollarsign ($) to select variables that were previously created - look for a grey thunderbolt in the advanced command screen.

Blue thunderbolt means: you can create a new variable (no need for dollar) or select one that was previously created).

Should you want to play with regular expressions:

Online help:

https://regex101.com/

Nintex RPA lets you test you regex inside the advanced command (e.g. find) and you can run it on a variable

Good luck. 

Translate

MillaZ
Nintex Employee
Forum|alt.badge.img+23
  • Nintex Employee
  • Aug 14, 2023 11:09 AM UTC

Hi @feckinirish 
Did this response help solve your question? 

Translate

Forum|alt.badge.img+3
  • Author
  • Rookie
  • Aug 15, 2023 12:39 AM UTC

Hello there.

I suggest you first try using split with the comma as delimiter (so don’t remove it) and save first / lastname as separate variables. you can set the comma as a delimiter by making it a variable (“set” or use the ascii command 44). You can then create a new variable that uses these found variables ($firstname$ $lastname$ in any order you set them in your new variable. Use a dollarsign ($) to select variables that were previously created - look for a grey thunderbolt in the advanced command screen.

Blue thunderbolt means: you can create a new variable (no need for dollar) or select one that was previously created).

Should you want to play with regular expressions:

Online help:

https://regex101.com/

Nintex RPA lets you test you regex inside the advanced command (e.g. find) and you can run it on a variable

Good luck. 

 

TBH Gobitz I didn’t understand the recommended process. What I did is outlined in the images below with the results.

Step 1

 

Log to instance

 

Workflow test

I tried ‘^[^,]*,([^,]+)’  (Thanks Chat GPT) which returned an empty first variable when using the SPLIT operation and the full input text when using the EXTRACT operation. 

Translate

MillaZ
Nintex Employee
Forum|alt.badge.img+23
  • Nintex Employee
  • Aug 28, 2023 10:29 AM UTC

Hi @feckinirish 
Is this question now resolved? 

Translate

Forum|alt.badge.img+3
  • Author
  • Rookie
  • Answer
  • Aug 28, 2023 11:55 PM UTC

No, though I’ve found an internal workaround.

Translate