Skip to main content

Notifications

Customer experience | Sales, Customer Insights,...
Answered

Double expand query does not return data

Posted on by 873

Hello,

I am trying to do a double expand query in the "List rows action" for dataverse to fetch data from related entities and as a result, it only returns an outcome from the first expand as for the second expand it does not return the headofdepartment value.

new_JobPosition($select=_cr884_department_value;$expand=cr884_Department($select=_new_headofdepartment_value))


Power-Automate-Expand-Result.pngPower-automate-input.png

Knowing that the expand query logically is correct and also to make sure that I have used the OData Web API with the same logic and that it returned the desired outcome:

https://ORGURL.dynamics.com/api/data/v9.2/cr884_job_title_histories?$select=statecode,_cr884_employee_no_value,_new_jobposition_value,cr884_end_date,_new_companyname_value&$expand=new_JobPosition($select=_cr884_employee_value,cr884_job_positions,_cr884_department_value;$expand=cr884_Department($select=_new_headofdepartment_value))&$filter=(_cr884_employee_no_value eq ce425204-aaa6-ec11-983f-0022489ef0f2 and statecode eq 0) and (new_JobPosition/cr884_job_positionid ne null)&$orderby=createdon desc&$top=1

Odata-result.png
What am I doing wrong in the expand query in the list rows action?

Any help is greatly appreciated.

Best regards,
Julien

  • Verified answer
    Abdul Wahab Profile Picture
    Abdul Wahab 12,070 Super User 2024 Season 1 on at
    RE: Double expand query does not return data

    Hi EBMRay ,

    I created the below query.

    pastedimage1669644875561v1.png

    Run in the Power Automate

    pastedimage1669645029831v2.png

    pastedimage1669645061668v3.png

    I can see the value from the second join. Are you doing the same and not getting values?

  • EBMRay Profile Picture
    EBMRay 873 on at
    RE: Double expand query does not return data

    Hello Abdul Wahab ,

    Yes, the query is correct and returning the right results,please find below the results of the below query:

      
        
        
        
        
        
        
          
          
        
        
        
          
          
          
          
            
          
        
      
    

    pastedimage1669634826362v1.png

    I tried to view the power automate parameters but it throws the below error:
    pastedimage1669634941891v2.png

    As the error is showing I cannot add the linked entity of the department on the first level because it will not show up the relationship between the department and the first table.

    (The department is related to the second link entity this is reason it is like that)

    What do you suggest as a solution in that case?

    best regards,

    ebmray

  • Suggested answer
    Abdul Wahab Profile Picture
    Abdul Wahab 12,070 Super User 2024 Season 1 on at
    RE: Double expand query does not return data

    Hi EBMRay,

    The first and most important thing is. Are you able to run this query direct on CRM? Is it returning values in the second expansion?

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

December Spotlight Star - Muhammad Affan

Congratulations to a top community star!

Top 10 leaders for November!

Congratulations to our November super stars!

Community AMA December 12th

Join us as we continue to demystify the Dynamics 365 Contact Center

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 291,240 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 230,149 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans