Skip to main content

Notifications

Power Automate - Building Flows
Answered

Expand Query

(0) ShareShare
ReportReport
Posted on by 28

I am trying to expand a query from List records. I noticed there are two different actions depending on if you use CDS (current environment) or CDS. In my example below "List records" is CDS (current environment) and "List records 2" is CDS. When I put the same expand query in both, only CDS (current environment) shows up. Can someone explain the different and how to solve this?

 

Thanks in advance

 

lokeshpatel_0-1598020674872.png

 

  • Verified answer
    Jcook Profile Picture
    Jcook 7,770 on at
    Re: Expand Query

    Hi @lokeshpatel 

     

    You want to parse the owninguser field since the expand brings the field over as a JSON object.

     

    You can use a Parse JSON action and use this expression in the Content input:

    first(outputs('List_records')?['body/value'])?['owninguser']

    What I did was run this with Schema as {}

    Than copied the JSON from the run and used Generate from sample to create the schema

     

    Jcook_0-1598034342369.png

     

    Doing this, you will be able to reference the values inside the expand query

     

  • lokeshpatel Profile Picture
    lokeshpatel 28 on at
    Re: Expand Query

    @Jcook 

     

    The example above was a sample. Here is the solution I'm implementing:

     

    lokeshpatel_1-1598031746939.png

     

    The issue I am getting is related to:

     
     

    https://powerusers.microsoft.com/t5/Building-Flows/Bug-in-Dynamics-List-Records-Action-JSON-gets-escaped/td-p/186437 

     

    photo.jpg

     

  • Jcook Profile Picture
    Jcook 7,770 on at
    Re: Expand Query

    Hi @lokeshpatel 

     

    Yes try using a Compose action, or use a select action and make sure the Value is the one from List records 2

     

    Also you can try and paste this into the From field in HTML table:

    @outputs('List_records_2')?['body/value']

    like this:

    Jcook_0-1598029715850.png

     

    Jcook_1-1598029831983.png

     

     

  • lokeshpatel Profile Picture
    lokeshpatel 28 on at
    Re: Expand Query

    Thanks @Jcook ,

     

    Unfortunately, that's not the issue. I have switched it before and it still does not populate. I would use the other CDS however, then I wouldn't be able to get the labels for option sets. 

     

    Should I populate a different input?

     

    Thanks!

  • Jcook Profile Picture
    Jcook 7,770 on at
    Re: Expand Query

    Hello @lokeshpatel 

     

    In your HTML table, you are using the Value from your List records, This is why you cannot reference the List records 2

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

Microsoft Kickstarter Events…

Register for Microsoft Kickstarter Events…

Announcing Our 2025 Season 1 Super Users!

A new season of Super Users has arrived, and we are so grateful for the daily…

Announcing Forum Attachment Improvements!

We're excited to announce that attachments for replies in forums and improved…

Leaderboard

#1
WarrenBelz Profile Picture

WarrenBelz 145,445

#2
RandyHayes Profile Picture

RandyHayes 76,287

#3
Pstork1 Profile Picture

Pstork1 64,741

Leaderboard