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

Community site session details

Session Id :
Customer experience | Sales, Customer Insights,...
Unanswered

XML working in FetchXML Builder but flow fails in power automate

(0) ShareShare
ReportReport
Posted on by 200

I'm trying to build a schedule flow to send an email when an estimated close date is within the next 14 days. The XML works fine and pulls through the correct data in Fetch XML Builder but doesn't work in the power automate schedule flow. I've used the XML from the view i want to look at in Dynamics and it shows the correct opportunities in the builder so not sure why it isn't working in the flow. 

<fetch version="1.0" output-format="xml-platform" mapping="logical" distinct="false" >
<entity name="opportunity" >
<attribute name="name" />
<attribute name="estimatedvalue" />
<attribute name="estimatedclosedate" />
<attribute name="ownerid" />
<attribute name="statuscode" />
<order attribute="estimatedclosedate" descending="false" />
<filter type="and" >
<condition attribute="statecode" operator="eq" value="0" />
<condition attribute="estimatedclosedate" operator="next-x-days" value="14" />
</filter>
<attribute name="opportunityid" />
</entity>
</fetch>

Any suggestions would be appreciated as I'm not experienced in XML and seem to be going round in circles trying to work it out. 

Thanks 

I have the same question (0)
  • meelamri Profile Picture
    13,216 User Group Leader on at
    RE: XML working in FetchXML Builder but flow fails in power automate

    Hi, 

    Please share your flow and the error message..

  • louisa lane Profile Picture
    200 on at
    RE: XML working in FetchXML Builder but flow fails in power automate

    This is the error message

    Syntax error: character '<' is not valid at position 0 in '<fetch version="1.0" output-format="xml-platform" mapping="logical" distinct="false" >

     <entity name="opportunity" >

       <attribute name="name" />

       <attribute name="estimatedvalue" />

       <attribute name="estimatedclosedate" />

       <attribute name="ownerid" />

       <attribute name="statuscode" />

       <attribute name="new_referraldate" />

       <attribute name="new_forecast" />

       <order attribute="estimatedclosedate" descending="false" />

       <filter type="and" >

         <condition attribute="statecode" operator="eq" value="0" />

         <condition attribute="estimatedclosedate" operator="next-x-days" value="14" />

       </filter>

       <attribute name="opportunityid" />

     </entity>

    </fetch>

    '.

    This is the step which we seem to fail at and get the above error. 

    pastedimage1626426593650v1.png

    Thanks

  • Thomas David Dayman Profile Picture
    11,323 on at
    RE: XML working in FetchXML Builder but flow fails in power automate

    Can you try and use the Dataverse connections instead of the deprecated connections?

    Maybe this might be the issue

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

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Neeraj Kumar – Community Spotlight

We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…

Leaderboard > Customer experience | Sales, Customer Insights, CRM

#1
Tom_Gioielli Profile Picture

Tom_Gioielli 179 Super User 2025 Season 2

#2
#ManoVerse Profile Picture

#ManoVerse 110

#3
Gerardo Rentería García Profile Picture

Gerardo Rentería Ga... 61 Most Valuable Professional

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans