web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Automate / How To: Parse InfoPath...
Power Automate
Unanswered

How To: Parse InfoPath XML into Dataverse table

(0) ShareShare
ReportReport
Posted on by

I am using the tutorial found here: https://deepakshrivastava.com/2021/05/18/working-with-xml-in-power-automate-flow/

 

This is my flow:

Patriarch3257_0-1694177114117.png

On all of the rows after the first one, I get this error on the Parse JSON step:

Patriarch3257_1-1694177443062.png

 

Only on the first record, I get this error on the insert:

Patriarch3257_2-1694179271846.png

 

All of my date conversions are performed with the following formula: 

parseDateTime(body('Parse_JSON')?['my:myFields']?['my:FormFields']?['my:CannotLocateAccount'],'en-US','yyyy-MM-dd')

 

This is the output of the Parse JSON:

 

{
 "body": {
 "?xml": {
 "@version": "1.0",
 "@encoding": "utf-8"
 },
 "?mso-infoPathSolution": "name=\"urn:schemas-microsoft-com:office:infopath:Bankruptcy:-myXSD-2016-04-29T14-04-00\" solutionVersion=\"1.0.0.222\" productVersion=\"15.0.0.0\" PIVersion=\"1.0.0.0\" href=\"https://cobbemc.sharepoint.com/teams/MemberCare/BillingTrainingCollect/CreditandCollections/FraudandBankruptcy/Report%20Templates/Bankruptcy.xsn\"",
 "?mso-application": "progid=\"InfoPath.Document\" versionProgid=\"InfoPath.Document.4\"",
 "my:myFields": {
 "@xmlns:xsi": "http://www.w3.org/2001/XMLSchema-instance",
 "@xmlns:xhtml": "http://www.w3.org/1999/xhtml",
 "@xmlns:my": "http://schemas.microsoft.com/office/infopath/2003/myXSD/2016-04-29T14:04:00",
 "@xmlns:xd": "http://schemas.microsoft.com/office/infopath/2003",
 "@xml:lang": "en-US",
 "my:FormFields": {
 "my:CustomerFirstName": "Lacotcha",
 "my:CustomerMiddleInitial": "",
 "my:CustomerLastName": "Davis",
 "my:BusinessName": "",
 "my:TaxIDNumber": "",
 "my:CaseNumber": "16-70959",
 "my:AccountNumber": "457160002",
 "my:Balance": "23.53",
 "my:AccountType": "Electric",
 "my:BankruptcyChapter": "7",
 "my:FiledProofOfClaim": {
 "@xsi:nil": "true"
 },
 "my:DateReceivedInOffice": "2017-05-16",
 "my:DateDisconnected": "2016-06-07",
 "my:DateProcessed": "2017-05-16",
 "my:SocialSecurityNumber": "284782669",
 "my:CodeAndSSNumEntered": "2017-05-16",
 "my:RemovedFromCollections": {
 "@xsi:nil": "true"
 },
 "my:EmailedCBCSorMCS": "false",
 "my:LetterSentNewAccountNumber": {
 "@xsi:nil": "true"
 },
 "my:NewAccountNumber": "",
 "my:DepositRequired": "false",
 "my:CaseConverted": {
 "@xsi:nil": "true"
 },
 "my:CaseDischarged": "2017-05-24",
 "my:CopySentTo": "Imaging",
 "my:CaseDismissed": {
 "@xsi:nil": "true"
 },
 "my:ReinstateCollections": "false",
 "my:TransferBalancetoNewAccount": "false",
 "my:CaseDismissedLetter": "false",
 "my:DismissalNoPreviousAccountLetter": "false",
 "my:CannotLocateAccount": {
 "@xsi:nil": "true"
 },
 "my:CannotLocateAccountLetter": "false",
 "my:CodeRemoved": {
 "@xsi:nil": "true"
 },
 "my:CollectionsReinstated": {
 "@xsi:nil": "true"
 },
 "my:CopyToGasSouth": {
 "@xsi:nil": "true"
 },
 "my:OpticalImaging": "2017-05-16",
 "my:Other": {
 "@xsi:nil": "true"
 },
 "my:EnterAPayment": "false",
 "my:MakeACorrection": "false",
 "my:PaymentsGroup": {
 "my:PaymentsGroup1": {
 "my:PGPaymentNumber": {
 "@xsi:nil": "true"
 },
 "my:PGPostedBy": "",
 "my:PGAmount": {
 "@xsi:nil": "true"
 },
 "my:PGDate": {
 "@xsi:nil": "true"
 },
 "my:PGPaymentNotes": ""
 }
 },
 "my:OriginalEnteredBy": "",
 "my:LetterForms": {
 "my:Letter582CheckBox": "0",
 "my:Letter583CheckBox": "0",
 "my:Letter584CheckBox": "0",
 "my:Letter585CheckBox": "0",
 "my:Letter587CheckBox": "0",
 "my:Form10CheckBox": "0",
 "my:Letter582Date": "",
 "my:Letter583Date": "",
 "my:Letter584Date": "",
 "my:Letter585Date": "",
 "my:Letter587Date": "",
 "my:Form10Date": "",
 "my:CBDRCheckBox": "0",
 "my:CBDRDate": ""
 },
 "my:BankruptcyType": "Residential",
 "my:Status": "Discharged",
 "my:DateFiled": "2016-11-22",
 "my:AddressLine1": "2407 Betsy Ct.",
 "my:AddressLine2": "",
 "my:City": "Marietta",
 "my:State": "GA",
 "my:Zip": "30008",
 "my:Deposit": {
 "@xsi:nil": "true"
 },
 "my:PhoneNumber": "404-307-5147",
 "my:Notes": {
 "my:Notes1": {
 "my:AdditionalComments": {
 "html": {
 "@xmlns": "http://www.w3.org/1999/xhtml",
 "@xml:space": "preserve",
 "#significant-whitespace": [
 "\n ",
 "\n ",
 "\n ",
 "\n"
 ],
 "p": [
 "​6/20/2017...rcvd notice of discharge of debtor with order approving trustee report of no distribution, closing estate and discharging trustee..dated 6/24/2017",
 "5/16/2017... rcvd notice of order on debtors 2nd motion to defer entry of discharge. because debtor did not appear at hearing motion has been denied...dated 5/4/17",
 "5/16/2017...#457160002 Lacotcha Davis, ch 7, case#16-70959, date filed 11/22/2016, northern dist of ga, sent to imaging...sw",
 "original write off date 5/16/2017"
 ]
 }
 }
 }
 }
 },
 "my:StatusGroup": {
 "my:FormName": ""
 },
 "my:MetaData": {
 "my:FormStatus": "Saved",
 "my:NonFiltered": "1"
 },
 "my:field1": "1"
 }
 }
}

 

 

It appears to me that the first Parse JSON attempt works, then all of the remaining rows fail, and on the first record, parsing the dates isn't working.

Categories:
I have the same question (0)
  • Verified answer
    Linn Zaw Win Profile Picture
    2,996 on at

    @Anonymous 

    That is because the value for my:CannotLocateAccount in your JSON is an object like that for null value if it does not contain the date value.

    "my:CannotLocateAccount": {
     "@xsi:nil": "true"
    }

     

    To conditionally parseDateTime without having an error, you need to check if the value is an object (starting with '{' character or not) and set the null value. Here's the sample expression for you

    if
    (
    	startsWith(string(body('Parse_JSON')?['my:myFields']?['my:FormFields']?['my:CannotLocateAccount']), '{'),
    	null,
    	parseDateTime(body('Parse_JSON')?['my:myFields']?['my:FormFields']?['my:CannotLocateAccount'],'en-US','yyyy-MM-dd')
    )

     

     

  • Community Power Platform Member Profile Picture
    on at

    Thank you.

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Automate

#1
Michael E. Gernaey Profile Picture

Michael E. Gernaey 523 Super User 2025 Season 2

#2
Tomac Profile Picture

Tomac 406 Moderator

#3
abm abm Profile Picture

abm abm 245 Most Valuable Professional

Last 30 days Overall leaderboard