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

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Microsoft Dynamics 365 | Integration, Dataverse...
Suggested Answer

Nullable fetch XML (or If statment) problem !

(0) ShareShare
ReportReport
Posted on by 15

Hi everybody,

I am destroying my toots on a problem that is maybe not so complex, but I want to be sure that I can't do it directly in my XML before implementing some kind of power automated workaround.

I have this kind of fetch XML query in my flow:

<fetch version="1.0" output-format="xml-platform" mapping="logical" distinct="false">
<entity name="bd_iccicase">
<attribute name="bd_iccicaseid" />
<attribute name="bd_name" />
<attribute name="createdon" />
<order attribute="bd_name" descending="false" />
<filter type="and">
<filter type="or">
<filter type="and">
<condition attribute="bd_name" operator="eq" value="@{triggerOutputs()?['body/bd_name']}" />
<condition attribute="bd_lastname" operator="eq" value="@{triggerOutputs()?['body/bd_lastname']}" />
<condition attribute="bd_birthdate" operator="on" value="@{triggerOutputs()?['body/bd_birthdate']}" />
</filter>
<condition attribute="bd_rrn" operator="eq" value="@{triggerOutputs()?['body/bd_rrn']}" />
</filter>
</filter>
</entity>
</fetch>

And I would add something to be sure that if the birthdate is null, the flow will not fail and list the records where there is no birthdate.

I have try to resolve this in this way:

<filter type="or">
<condition attribute="bd_birthdate" operator="null" />
<condition attribute="bd_birthdate" operator="on" value="@{triggerOutputs()?['body/bd_birthdate']}" />
</filter>

But my flow still fail on the second condition if my record have no birthdate...

I was thinking that maybe some kind of XML "if statment" to check if birthdate is not null before going into the second condition would maybe fix the problem, but I have no idea how to archive this... :/

Or if you have any suggestion on a better way to doing this, I would love to see you share your thoughts with me !

Thank you !

I have the same question (0)
  • Suggested answer
    Pradeep Rai Profile Picture
    5,489 Moderator on at

    Hi,

    Retrieve all records without adding birthdate condition in FETCHXML.

    Now, you can use NULL check condition in power automate to validate the Birthdate field.

    as described in below link:
    https://www.sharepointpro.com.au/blog/checking-if-string-is-empty-or-null-in-ms-flow-power-automate/

  • Suggested answer
    Amit Katariya007 Profile Picture
    10,409 Super User 2025 Season 2 on at

    I guess you can just fetch all the record where it having birthdate. It will solve the problem.

    And if you need all the records then first get all the records and add a condition stating if you have birthdate then using logic 1 else use logic 2....

    Thank you,

    Amit Katariya

  • Suggested answer
    Naveen Ganeshe Profile Picture
    3,397 User Group Leader on at

    Hi DynaMoX,

    You can try this filter:

    <filter type="or">

       <condition attribute="bd_birthdate" operator="not-null"/>

       <filter type="and">

           <condition attribute="bd_birthdate" operator="on" value="@{triggerOutputs()?['body/bd_birthdate']}" />

           <condition attribute="bd_rrn" operator="eq" value="@{triggerOutputs()?['body/bd_rrn']}" />

       </filter>

    </filter>

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 > Microsoft Dynamics 365 | Integration, Dataverse, and general topics

#1
Siv Sagar Profile Picture

Siv Sagar 93 Super User 2025 Season 2

#2
#ManoVerse Profile Picture

#ManoVerse 76

#3
Martin Dráb Profile Picture

Martin Dráb 64 Most Valuable Professional

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans