web
You’re offline. This is a read only version of the page.
close
Skip to main content
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Automate / dataverse list rows ap...
Power Automate
Unanswered

dataverse list rows append to array retrieves no value

(0) ShareShare
ReportReport
Posted on by 295

Hello,

I am trying to produce an array to use in an email, the array values come from a related entity.

I have looked at mulitple blogs and still I get no values.

I am able to retrieve the information for the related entity but when I append to an array I get no values.

The table is QPOrders.

The related table is QPContainers.

For one order there are multiple containers, I want to get all the container id's related to the order.

 

When the row is modified, get the row by ID, I use compose to get the order status for a switch statement later on, Initialise a Array variable.

Rosie_1-1675218237612.png

 

Then use List Rows to the the container numbers from the related table QPContainers.

Rosie_2-1675218313771.png

Then an apply to each using 

outputs('List_row_-_ContainerDetails')?['body/value']

The json sample used is the first item in the body.

Rosie_3-1675218373156.png

 

As you can see in the Parse Json output the containers ids are there but for some reason they don't appear in the array.

 

Rosie_0-1675218105322.png

 

Many thanks

Rosie

 

Categories:
I have the same question (0)
  • v-chengfen-msft Profile Picture
    on at
    Re: dataverse list rows append to array retrieves no value

    Hi @Rosie ,

    Judging from the screenshot you provided, the ID you need to obtain exists in the array, and you should need an [Apply to each] to traverse (the part enclosed in orange in the screenshot), and then add ID to the array

    vchengfenmsft_0-1675219973438.png

    I made a test to get the ID in the array in Object:
    Need to traverse the array to get its ID

    vchengfenmsft_1-1675220702241.png

     

     

    Best Regards

    Cheng Feng

  • Rosie Profile Picture
    295 on at
    Re: dataverse list rows append to array retrieves no value

    Hello,

    Thanks for that, I have made some progress but it keeps adding a 2nd apply to each when I add in the field to the array.

    I am not sure how to stop this happening - I must be picking the wrong part of the json.

    I select qp_Containers_qp_Orders_qp_Orders as the output from the previous step.

    When I go to add the field in the array variable, I can actually see the qp_containerid variable.  When I add it suddenly another Apply to each is added.

     

    Rosie_0-1675221744685.png

     

  • Verified answer
    grantjenkins Profile Picture
    11,063 Moderator on at
    Re: dataverse list rows append to array retrieves no value

    @Rosie Directly after your List rows - ContainerDetails, can you add a Compose and use the following expression. This should return all the qp_containerid values in an array for you. This will eliminate the need for a loop and appending to an array, etc. See how it goes and let me know if any issues.

     

    xpath(xml(json(concat('{"root": ', outputs('List_rows_-_ContainerDetails')?['body'], '}'))), '//qp_containerid/text()')

     

    grantjenkins_0-1675223551363.png

     

  • Rosie Profile Picture
    295 on at
    Re: dataverse list rows append to array retrieves no value

    Hi @grantjenkins,

    Thanks for the suggestion but that didn't seem to work for me.

    I used the Compose Data operation and pasted in the code.

    There is no output other than the same piece of code.

    For some reason in List rows I don't get a 'Show raw outputs' option.  Only download.  Not sure if this is impacting the outcome I am getting.

    Rosie_0-1675276405287.png

     

  • grantjenkins Profile Picture
    11,063 Moderator on at
    Re: dataverse list rows append to array retrieves no value

    @Rosie It looks like you may have just added the expression directly as text. You'll need to add it as an actual expression.

     

    grantjenkins_0-1675295098898.png

     

  • Rosie Profile Picture
    295 on at
    Re: dataverse list rows append to array retrieves no value

    @grantjenkins you are quite right, what was I thinking.

    I will give that another go.

    Thanks so much.

  • Rosie Profile Picture
    295 on at
    Re: dataverse list rows append to array retrieves no value

    Hi @grantjenkins ,

    I am getting results now, thanks so much.

    For each value in a row do I need to create a Compose actions, then Append to the variable?

    I need to the results to be in the email, I have tried "Create HTML Table" but there is something not right.

    Maybe you can provide some guidance?

    Rosie_0-1675725859544.png

     

    Many thanks

    Rosie

  • Rosie Profile Picture
    295 on at
    Re: dataverse list rows append to array retrieves no value

    To take the compose output to a table (for each set of values retrieved) see the solution in this post.

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 hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Automate

#1
Tomac Profile Picture

Tomac 497 Moderator

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 477 Super User 2025 Season 2

#3
chiaraalina Profile Picture

chiaraalina 242

Last 30 days Overall leaderboard