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 deal with an em...
Power Automate
Answered

How to deal with an empty XML File in Power Automate?

(0) ShareShare
ReportReport
Posted on by 555

 I have an XML File generated by a PowerBI report and sent to us as an email attachment.

I have a FLOW1 that takes the Email attachment and places in a SP Library.

My Flow2 takes the File Content from SP Library and creates records in the SP List.

The FLOW2 works fine as long as there are records in the XML File.

However, we got an XML file with no records. My FLOW failed at Parse JASON step.

How do I circumvent this issue as every now and then there may be a file with no records - Just a header?!

 

I tried condition step with 

length(outputs('Get_file_content')?['body/value'])  greater than 0
and
it gave me the following error:
"InvalidTemplate. Unable to process template language expressions for action 'Condition' at line '1' and column '39899': 'The template language function 'length' expects its parameter to be an array or a string. The provided value is of type 'Null'. Please see https://aka.ms/logicexpressions#length for usage details.'."
 
Please help.
Thanks,
SueA
 
Categories:
I have the same question (0)
  • Verified answer
    v-chenzhi Profile Picture
    on at

    Hi @SueA ,

     

    When the xml file is empty, do you want to continue running the flow2 even if Parse JSON fails?

    I found an alternative method for your reference, please try the following workaround.

    vchenzhi_0-1637292768035.png

    Choose Configure run after, Select all these scope statuses you need.

    vchenzhi_1-1637292768038.png

    Here is the expression:

    result('Scope')[0]['status']

     

     

    Best Regards,

    Zhi Chen

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 525 Super User 2025 Season 2

#2
Tomac Profile Picture

Tomac 324 Moderator

#3
abm abm Profile Picture

abm abm 232 Most Valuable Professional

Last 30 days Overall leaderboard