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 !