Skip to main content
Nintex Community Menu Bar
Solved

Remove guids from string using regex

  • January 22, 2024
  • 1 reply
  • 114 views

Forum|alt.badge.img+9

I am trying to use workflow to migrate values from a managed metadata column to a choice column. How can I keep the labels and replace everything else with ;#. ?

 

Input string: 

Buying Agent|a77795cc-c97a-4965-ad6c-099ee89d8f66;Accounts Manager|a831fa17-5cd2-47ae-964a-bfbf283df5ac;Reports Role|5e80eaaa-14be-4e95-998f-52c025ed286a;View Role|689cc436-5b04-4497-bf2c-93fc8b845666;Orders|a4ae04d9-f1f8-4204-bb6f-15bcdf8c2d62;Vendor Invoices|5cd3e02e-e7ce-42e6-a084-1d77c3d39683

(no semicolon at the end)

 

Desired output string:

Buying Agent;#Accounts Manager;#Reports Role;#View Role;#Orders;#Vendor Invoices

Best answer by MegaJerk

Assuming that your guids never have uppercase letters as you’ve shown there, then the following should work: 

\|[a-z0-9\-]*\;?

 

Example:

Note however that this adds a “;#” to the end of the output string, which will likely result in an empty value at the end of a collection. You’ll need to run this string through another regex action to remove that last delimiter. 

 

so, the regex will be:

\;\#(?=$)

 

with results:

 

View original
Translate
Did this topic help you find an answer to your question?

1 reply

MegaJerk
Forum|alt.badge.img+14
  • Scholar
  • 832 replies
  • Answer
  • January 23, 2024

Assuming that your guids never have uppercase letters as you’ve shown there, then the following should work: 

\|[a-z0-9\-]*\;?

 

Example:

Note however that this adds a “;#” to the end of the output string, which will likely result in an empty value at the end of a collection. You’ll need to run this string through another regex action to remove that last delimiter. 

 

so, the regex will be:

\;\#(?=$)

 

with results:

 

Translate

Reply


Cookie policy

We use cookies to enhance and personalize your experience. If you accept you agree to our full cookie policy. Learn more about our cookies.

 
Cookie Settings