Skip to main content

Notifications

Announcements

No record found.

Microsoft Dynamics CRM forum
Unanswered

XML working in FetchXML Builder but flow fails in power automate

Posted on by 186

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 

Categories:
  • 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 186 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,198 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

Anton Venter – Community Spotlight

Kudos to our October Community Star of the month!

Announcing Our 2024 Season 2 Super Users!

A new season of Super Users has arrived, and we are so grateful for the daily…

Dynamics 365 Community Newsletter - September 2024

Check out the latest community news

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 290,564 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 228,651 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,148

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans