Replace LOC Value

Hi Team,
Below is the data extracted using GetText and stored in variable ‘STR1’.
I want the BOT to replace datavalue of “LOC:IN TRANSIT,” to LOC: NA.
it can be anything between colon to comma in LOC as value to which BOT will replace with LOC: NA.

LOC: 12345, to be replaced with LOC:NA,
LOC:IN TRANSIT, to be replaced with LOC: NA,
etc.

Please help in this.

QN:201329001,
SN:NST000,
FRAT:1054573,
LOC: IN TRANSIT,
RMA:,

Hello @Zara :wave:

You can make use of the ‘Replace’ activity and provide a regex expression to achieve this.

Here’s a sample workflow: LOC_Forum.xaml (4.3 KB)

Cheers!

1 Like

Hey @monsieurrahul,
I tried using this…
It replaces words…but if there is something like ‘LOC:123’ or ‘LOC:1234#’ then it gives output as ‘LOC:123 NA’ which should be just ‘LOC:NA’

Hello @Zara, sorry about that. Use this regex expression instead:

"LOC:\s*[A-z1-9@#$%&*\s]*"

Cheers!

1 Like