HI i need to extract text from json response

hii every one i need to get sys id , number, request id separately ho can i do that from the below response

{“result”:{“sys_id”:“f18ba213dbdea8d0d5609726f396197b”,“number”:“REQ0563200”,“request_number”:“REQ0563200”,“request_id”:“f18ba213dbdea8d0d5609726f396197b”,“table”:“sc_request”}}

Hi @bpt.teja1996 ,

I’m not an expert, but you could use regex expressions here.

For instance, if you would like to extract the sys id from any string similar with the above one, the you could use something like:
(?<=sys_id”:“)(.*)(?=”,“number”) source: regex101: build, test, and debug regex

By replacing the boundary strings (sys_id”:“ & ”,“number”), you can extract what ever you would like

Hope this helps
Best regards,
Marius

@bpt.teja1996 - This pattern will extract both label and string…

@Marius_Puscasu @prasath17 thank you all but how can i implement it in uipath can any one help me

Hi @bpt.teja1996 .

You could use the Matches activity. Please refer to this link https://docs.uipath.com/activities/docs/matches

Please check the example in order to see how to use it in UiPath

Best regards,
Marius

@bpt.teja1996 - Please find the starter help here…Main.xaml (9.6 KB)

1 Like

@bpt.teja1996
as the string is a JSON we can process and access it with JSON options:

Parse it:
grafik

Loop it:
grafik
grafik

Access it e.g. sys_id:
grafik

find starter help here:
ObjectFromObjectPropertyRetrieval.xaml (5.8 KB)

done with sample json:
sample.json (211 Bytes)

Thank you very much all

@ppr @prasath17 @MUTHUKUMAR_RAMACHANDRAN @Marius_Puscasu
i need one more help
i have a string
Recently our Distribution lists are not automatically updated ( for the past 2 months)
I have to contact ITTICS support for every new joiners or transfers.
Could you please fix this issue for the future?

but i need every thing in none line to pass the input how can i make all the line in one line

@bpt.teja1996
depends on the used line break

givce a try on
YourStr.Replace(Environment.NewLine," ")

@ppr no it was not working :sob:

it was giving error like remove //n error

@ppr @prasath17 @MUTHUKUMAR_RAMACHANDRAN @Marius_Puscasu can any on :sob: help me please

as mentioned depends on your linebreak.
debug for us, and show us the string details from locals, watch or immediate panel
or tell us the details from where the string is coming from

other options are
Split on \r - vbCr
Split on \n vbLf

@ppr the string is coming from excel

give try with these from above in replace as descibed above e.g.
ourStr.Replace(vbLf," ")

@ppr no same error

grafik
and removing:
grafik

@ppr can u try this text copying in one of the excel

Recently our Distribution lists are not automatically updated ( for the past 2 months)
I have to contact ITTICS support for every new joiners or transfers.
Could you please fix this issue for the future?

any test from our side would not replicate your scenario:
the screenshots from above (immediate panel) was done on a excel readin with linebreak
and the \n was replaceable.

Same suggestion show us the details from your end e.g. from debug /watch /immediate panel.

Another thing is that now the line break removal is now away from original topic. Better is to keep the topics thread not mixed up (will help researchers for similar cases). Keep this topic for the JSON / text retrieval. And feel free to open a new topic for the Linebreak removal. Thanks