Skip to main content

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. 

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. 


Hi @feckinirish 
Did this response help solve your question? 


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 ‘^d^,]*,(t^,]+)’  (Thanks Chat GPT) which returned an empty first variable when using the SPLIT operation and the full input text when using the EXTRACT operation. 


Hi @feckinirish 
Is this question now resolved? 


No, though I’ve found an internal workaround.


Reply