Extract Data from XML

Dear Experts,

We have some barriers in extracting data from XML, Our sequence contains HTTP request, deserialize XML and its result. But we only need to extract every “ObjectID” and “ProjectID” containing in that XML.
Let me know how can I extract all the contain data field from XML. Thanks for your help.
PJC.txt (1.7 MB)

One possible solution is to use below regular expression with the Matches activity:

(?<=(ObjectID|ProjectID)\s*>\s*)\w+(?=\s*<)

1 Like

@Htwe_Ko_Ko_Wynn
your XML is defining several namespaces which is to handle for the retrieval

find starter help here:
GetElements_Namespace-ATOM.xaml (7.4 KB)

Preview to the logs:
grafik

1 Like

Hi All, thanks for your solutions, and is there any examples of we can export these extracted data into a datatable? I am testing of writing it to excel or to SQL database. thanks.

@Htwe_Ko_Ko_Wynn
you can set up like following:

  • define with build datatble the datatable structure as needed
  • use add datatrow for filling up the datatable
  • use datatable e.g. within a write range and write extracted data to Excel

also have a look here to find and alternate approach for retrieval with namespaces and XPath

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.