Skip to main content

Notifications

Announcements

No record found.

Customer experience | Sales, Customer Insights,...
Unanswered

XML working in FetchXML Builder but flow fails in power automate

(0) ShareShare
ReportReport
Posted on by 188

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 

  • Thomas David Dayman Profile Picture
    Thomas David Dayman 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

  • louisa lane Profile Picture
    louisa lane 188 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

  • meelamri Profile Picture
    meelamri 13,204 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..

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

December Spotlight Star - Muhammad Affan

Congratulations to a top community star!

Top 10 leaders for November!

Congratulations to our November super stars!

Tips for Writing Effective Verified Answers

Best practices for providing successful forum answers ✍️

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 291,419 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 230,492 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans