How to read tag from api response


how can i find tag eighteen_or_older,Sponsorship_USA,Future_Sponsorship please guys help me with example

is there anybody to help me out

Can you copy the XML file you’re using?

API reponse.txt (16.8 KB)
Hi @Parth_Doshi here i have copy reponse whatever i get from that response i have check below details

eighteen_or_older,=YES
Sponsorship_USA,=No
Future_Sponsorship=No
job profile=…
skills=…
If tag not found throw exception can anyboady help me out guys please

Do you have to check only this five tags or there are other as well?

And does the text remain the same always like this text is there:

wd:eighteen_or_olderYes</wd:eighteen_or_older>

yes 5 tag only as of now i am getting xml reponse and format is same not sure for other record that will give the same format but from response i will have to search for these 5 tage only if not found then i just need to throw exception

If the tags are fixed then just simply use regex instead of deserializing for example see the below screenshot:


Similarly you can write and use the regex for other tags if match found then value is present or else it is not present.

Hope this helps.

Cross reference:

I have extract that the i will have to check if that is yes or no if yes then i will have to another tasks to do if no i have to do another task

After you get a value from regex just simply use Contains function of string if it has Yes then perform steps accordingly this should work.

but one more thing that repose i have copied from postman
actual desterilized response is like in screenshot


this is what i am writing code

That is fine no issues with that. Just use the regex I shared previously and then if Output of regex is not null then check if it contain Yes or No and perform steps accordingly.

can you please provide that regex here

Here it is: (?<=eighteen_or_older>).*

replace the text for other tags and use it.

in assign activity how can i write that

I think i need to write somthing like system.regex

[CheatSheet] - System.Text.RegularExpressions | RegEx - News / Tutorials - UiPath Community Forum


i am writing like this

grafik

kindly note: we do provide the text and the pattern within the match method