i want to pass multiple variable to my below FetchXML for (msdyn_workorderid) parametar
in my case i pass 10 ststic parametars
Is there another solution that makes it automatic?
Without installing the number of fild?
My FetchXML:
<fetch distinct="true" >
<entity name="msdyn_workorder" >
<attribute name="msdyn_workorderid" />
<attribute name="msdyn_serviceaccount" />
<attribute name="msdyn_systemstatus" />
<filter type="and" >
<condition attribute="msdyn_workorderid" operator="in" >
<value>24ab086a-2c61-e911-a968-000d3a4648ef</value>
<value>f2871258-2c61-e911-a968-000d3a4648ef</value>
<value>7277083a-2c61-e911-a968-000d3a4648ef</value>
<value>ff2ba362-2a61-e911-a968-000d3a4648ef</value>
<value>6e88794d-2261-e911-a968-000d3a4648ef</value>
<value>0e8fe571-2360-e911-a964-000d3a4647a5</value>
<value>ed51492e-2260-e911-a964-000d3a4647a5</value>
<value>7542cb07-2160-e911-a964-000d3a4647a5</value>
<value>6f42cb07-2160-e911-a964-000d3a4647a5</value>
<value>59bf33e0-9c5f-e911-a964-000d3a4647a5</value>
</condition>
<condition attribute="msdyn_systemstatus" operator="in" >
<value>1</value>
<value>2</value>
<value>3</value>
</condition>
</filter>
</entity>
</fetch>
*This post is locked for comments
This is quite difficult to understand where to put it. Am I assuming correctly this is done in Power Auttomate?
thanks Goutam
for your answer
Yes you can declare before preparing the fetchXML like below -
var GuidArray= ["{25A17064-1AE7-E611-80F4-E0071B661F01}", "{25A17064-1AE7-E611-80F4-E0071B661F01}", "{25A17064-1AE7-E611-80F4-E0071B661F01}"];
But anywhere put GuidArray array ?
i use that fetxhxml to create API for Mobile Application
Hi Abdelrhman,
Using for loop you can add 'Value' node dynamically as suggested by Pranav
Hi ,
Make sure you are passing GUID within {}.
You can prepare the fetchXML using Advanced Find. Here is sample one -
<fetch version="1.0" output-format="xml-platform" mapping="logical" distinct="false"> <entity name="account"> <attribute name="name" /> <attribute name="primarycontactid" /> <attribute name="telephone1" /> <attribute name="accountid" /> <order attribute="name" descending="false" /> <filter type="and"> <condition attribute="primarycontactid" operator="in"> <value>{25A17064-1AE7-E611-80F4-E0071B661F01}</value> <value>{49A0E5B9-88DF-E311-B8E5-6C3BE5A8B200}</value> <value>{9DA07064-1AE7-E611-80F4-E0071B661F01}</value> </condition> </filter> </entity> </fetch>
Try to write like below -
var fetchXml = "<fetch distinct='true'>"+
"<entity name='msdyn_workorder'>" +
"<attribute name='msdyn_workorderid'/>" +
"<attribute name='msdyn_serviceaccount'/>" +
"<attribute name='msdyn_systemstatus'/>" +
"<filter type='and'>" +
"<condition attribute='msdyn_workorderid' operator='in'>"
for (var i = 0; i < GuidArray.length; i++) { // Assuming that you have array of Guid which is GuidArray .
fetchXml += "<value>" + GuidArray[i] + "</value>";
}
fetchXml += "</condition ><condition attribute='msdyn_systemstatus' operator='in' >" +
"<value>1</value>" +
"<value>2</value>" +
"<value>3</value>" +
"</condition>" +
"</filter >" +
"</entity >" +
"</fetch >";
Hi,
Could you please help me understanding more about the situation, where are you using this fetchxml? and from where you are fetching these static guid id's?
Hi
Unfortunately, there is no direct way of doing this in current SDK version.
You can try giving individual elements as arguments: (indicative code)
string fetchxml = @"<fetch mapping='logical'>
<entity name='contact'>
<attribute name='firstname' />
<filter type='and'>
<condition attribute='lastname' operator='not-in'>
<value>"+array[0]+@"</value>
<value>"+array[1]+@"</value>
</condition>
</filter>
</entity>
</fetch>";
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