Hi all,
Currently working on an integration at the moment, and it involves exporting a Leave Request and its related Leave Request Details using Microsoft Flow once the Leave Request is approved.
Can't seem to get the related Leave Request Detail entity using either the "Get record" or "List record" CDS actions. "Get record" doesn't accept the foreign key Leave Request as its item identifier - it says "cdm_leaverequestdetail With Id = c94b244c-fdd9-e911-a977-000d3ab6d727 Does Not Exist", and "List record" says "Could not find a property named 'LeaveRequest' on type 'Microsoft.Dynamics.CRM.cdm_leaverequestdetail'."
Is there a different way of retrieving the Leave Request Detail via Flow using a different property?
Any help is greatly appreciated.
The field you need to use in your filter query is actually "_cdm_leaverequestid_value" and not "cdm_leaverequestid" ... I have no idea why it puts the underscore in front and a "_value" at the end, but if you do a general List Records with all records (and do a top=1 just to limit the results) you'll see that "_cdm_leaverequestid_value" is returned. So later in your Flow you can do an expression of first(body('LeaveRequestDetails')?['value'])?['cdm_leavedate'] (or whatever field). [This assumes the action is named "LeaveRequestDetails" like my example below ... which has a trigger of an update on a LeaveRequest entity. So you can avoid the double trigger and wait until mentioned in the other solution (which I didn't true, but I assume would work as well).
Hope this helps!
If someone else is struggling with this, I managed to fix my issue! You can have two triggers - one for the details and the other for the request. You can then use a "Do until" action to effectively wait until the condition is correct. Hope this helped someone!
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... 290,782 Super User 2024 Season 2
Martin Dráb 229,067 Most Valuable Professional
nmaenpaa 101,150