Hi, I am developing a project to manage CRM online data, using Microsoft Flow to integrate with SharePoint I came to a point where the volumes had to be more controlled.
My solution was to run Fetch XML based queries from a C# application, issue was to pass a parameter to my query dynamically.
My solution is as follows and I would like to discuss this in further detail.
var fetchXmlAttachments = $@"<fetch>
<entity name='sharepointintegration' >
<attribute name='sharepointintegrationid' />
<attribute name='incidentid' />
<filter type='and' >
<condition attribute='sharepointintegrationid' operator='eq' value='" + integrationid.ToString() + @"' />
</filter>
<link-entity name='email' from='regardingobjectid' to='incidentid' link-type='inner' >
<attribute name='regardingobjectid' />
<link-entity name='activitymimeattachment' from='objectid' to='activityid' >
<attribute name='activitymimeattachmentidunique' />
<attribute name='activitymimeattachmentid' />
<attribute name='attachmentid' />
</link-entity>
</link-entity>
</entity>
</fetch>";