Skip to main content

Notifications

Dynamics 365 Community / Forums / Human Resources forum / Getting related Leave ...
Human Resources forum

Getting related Leave Request Details using Leave Request in Microsoft Flow

Posted on by 80

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.

Categories:
  • Suggested answer
    cbboatwr Profile Picture
    cbboatwr 5 on at
    RE: Getting related Leave Request Details using Leave Request in Microsoft Flow

    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).

    pastedimage1591739752804v1.png

    Hope this helps!

  • Suggested answer
    Ciara Lynch Profile Picture
    Ciara Lynch 80 on at
    RE: Getting related Leave Request Details using Leave Request in Microsoft Flow

    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!

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Forum Structure Changes Coming on 11/8!

In our never-ending quest to help the Dynamics 365 Community members get answers faster …

Dynamics 365 Community Platform update – Oct 28

Welcome to the next edition of the Community Platform Update. This is a status …

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 290,782 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 229,067 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,150

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans