Solved

Extract a word from comma separated combination.

  • 10 August 2023
  • 5 replies
  • 279 views

Badge +1

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. 

icon

Best answer by feckinirish 29 August 2023, 01:55

View original

5 replies

Userlevel 1
Badge +6

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. 

Userlevel 5
Badge +20

Hi @feckinirish 
Did this response help solve your question? 

Badge +1

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. 

Userlevel 5
Badge +20

Hi @feckinirish 
Is this question now resolved? 

Badge +1

No, though I’ve found an internal workaround.

Reply