Skip to main content
Known Participant
April 9, 2021
Question

Need help on reading XML files

  • April 9, 2021
  • 19 replies
  • 0 views

Hi,

I have a below requirement. Could someone please help me?

1. Customers claims come in an XML along with the required documents to Appian for further processing.

2.I need to have knowledge on how to read the xml and also, read the documents in Appian and save the overall information to appian DB.

Thanks

Faisal

    19 replies

    stefanhelzle0001
    Brainy
    April 9, 2021

    Please elaborate. We need way more details to help and cannot analyze your requirement.

    https://codeblog.jonskeet.uk/2012/11/24/stack-overflow-question-checklist/

    In general this helps to read XML files

    docs.appian.com/.../fnc_scripting_xpathsnippet.html

    Known Participant
    April 12, 2021

    Hi Stefan ,

    Thanks for the reply!

    We have one XML file with the claim details and all those claim details to be written in Appian.

    How can I read all the XML fields in Appian?

    Do I need to create an exact CDT and use Process Model to use this function?

    XML:

    <?xml version="1.0" encoding="UTF-8" standalone="yes"?><Intake_ClaimBatch><CreatedDateTimeUTC>2017-12-12T18:02:38.890-05:00</CreatedDateTimeUTC><BatchID>101009</BatchID><ClaimCount>1</ClaimCount><ClaimSystemBatchID>0</ClaimSystemBatchID><ClaimDetails><ClaimMetaData><UniqueClaimID>552300</UniqueClaimID><GlobalIntakeID>0</GlobalIntakeID></Intake_ClaimBatch>

    stefanhelzle0001
    Brainy
    April 12, 2021

    Where is the XML coming from? This would probably answer your question whether you need a process model or not.

    Regarding reading the XML. I would create an expression which transforms the XML into an Appian CDT. You can do that via toRecord()

    https://docs.appian.com/suite/help/21.1/fnc_scripting_torecord.html

    or use xPathSnippet/xPathDocument to read each value individually. I would prefer the second way as it provides more flexibility.

    This expression can be used in a process or wherever you need.