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 !
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>
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
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/
Stay up to date on forum activity by subscribing. You can also customize your in-app and email Notification settings across all subscriptions.
André Arnaud de Cal... 291,253 Super User 2024 Season 2
Martin Dráb 230,188 Most Valuable Professional
nmaenpaa 101,156