Need to extract specific tag from XML

Hi,

Need to extract data from a specific tag in XML output, please share your ideas…
Find below pic highlighted

Thanks

Hi @Deeipauk

This should return the value:

System.Text.RegularExpressions.Regex.Match(yourVariable,"(?<=\<AuthenticateUserResult\>).+(?=\<\/AuthenticateUserResult\>)").ToString

See here for more info.

1 Like

Thanks…This needs to be kept in Assign activity?

That is correct, assign this to your output variable.

Yes its working, Thanks…

Just to add a point – yourVariable should be a string variable

1 Like

I felt this regular expression can help me to find solution in another level. After extracting this information I need to place it in another XML tag… below is the source XML and where I need to replace this extracted value, if you have any suggestions will help me move ahead.

image

It is possible :slight_smile:
This one will do it:

System.Text.RegularExpressions.Regex.Replace(finalString,"(?<=\<urn:AuthenticationToken\>).+(?=\<\/urn:AuthenticationToken\>)","newValue") 

See this project for ease of reference:
RegexSolution.zip (2.2 KB)

1 Like

Thats great :slight_smile: its working fine…

Thanks for your help

1 Like