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

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / Help with empty result...
Power Apps
Unanswered

Help with empty result filtering

(0) ShareShare
ReportReport
Posted on by 85

Hi all,

I'm using a Response to get data in a Flow and create a collection in my PowerApp.

 

Hi all,

I'm using a Response to send results back to a PowerApp.  The way it's returned right now, the collection shows the "Value" columns, and there's a column called "Result" which has a table of the values I need in each.

The challenge is, the response has multiple values which have an empty "Result" and one "Result" which has my data I want in it.  Unfortunately, it's tough to say if it will be the first "Result" or the 2nd, or etc.  So I can't use "First", but I don't know of a way to say "Whichever Result array member has data in it, use that".  I've tried unsuccessfully getting the Flow to only return the "Result" which has data in it using Filter Array where length of Result is > 0.  My lack of experience is likely to blame for this :). So i'm now trying to put the responsibility on my PowerApp to only display the Result array member that has data, though I do feel like fixing it in my Flow is probably the right answer.

 

{
  "value": [
    {
      "Status""1",
      "MoreResult"false,
      "Result": [
        {
          "Title""Notepad++ 7.9.1 (x64)",
          "UpdateId""120c2643-20f7-4b2c-9389-9f3ef32e9343",
          "KBArticleIDs""KBPMPC-2020-11-02",
          "SecurityBulletinIDs""PMPC-2020-11-02",
          "Categories""SCUP Updates,Updates",
          "Device""SUP1"
        },
        {
          "Title""Microsoft Edge-Stable Channel Version 87 Update for x64 based Editions (Build 87.0.664.60)",
          "UpdateId""d250733d-32c4-480b-9f9e-59daa328b0c3",
          "KBArticleIDs""",
          "SecurityBulletinIDs""",
          "Categories""Microsoft Edge,Updates",
          "Device""SUP1"
        },
        {
          "Title""Security Intelligence Update for Microsoft Defender Antivirus - KB2267602 (Version 1.329.291.0)",
          "UpdateId""c737e307-723d-4cfd-adf8-c554ab6d7f4a",
          "KBArticleIDs""KB2267602",
          "SecurityBulletinIDs""",
          "Categories""Definition Updates,Microsoft Defender Antivirus",
          "Device""SUP1"
        }
      ]
    },
    {
      "Status""1",
      "MoreResult"false,
      "Result": []
    },
    {
      "Status""1",
      "MoreResult"false,
      "Result": []
    },
    {
      "Status""1",
      "MoreResult"false,
      "Result": []
    },
    {
      "Status""1",
      "MoreResult"false,
      "Result": []
    },
    {
      "Status""1",
      "MoreResult"false,
      "Result": []
    },
    {
      "Status""1",
      "MoreResult"false,
      "Result": []
    },
    {
      "Status""1",
      "MoreResult"false,
      "Result": []
    }
  ]
}
 
Thanks
Categories:
  • Pstork1 Profile Picture
    69,661 Most Valuable Professional on at

    Since only the first member of the Value array contains data what you want to do is isolate the Result in that array member and only send that back.  Use the formula below to isolate it using the First() function.  Make sure to also adjust the schema to only include the Result and then store it in a collection in Power apps.

    first(body('Parse_JSON')?['value'])?['Result']

     

  • russrimm1 Profile Picture
    85 on at

    Hi @Pstork1 thanks, i've been trying (using length > 0) to isolate that one Result to be the only member returned - unsuccessfully so far.  I've been trying a Filter array with length(item()?['Result']) and an "is greater than"  0.

  • Pstork1 Profile Picture
    69,661 Most Valuable Professional on at

    Your only real choice then would be to process Value using an Apply to Each to find the entry that isn't empty.  You can also retrieve the value using a 0 delimited array index like this.  But you would need a loop to find the index to use.  For example this would retrieve the third Result array.

     

    body('Parse_JSON')?['value'][2]?['Result']

     

    To filter inside the Loop you would use this to count the number of entries.  The entry > 0 is the index you want.

    length(items('Apply_to_each')?['Result'])

     

  • russrimm1 Profile Picture
    85 on at

    Thanks @Pstork1 what would I need to use as the input to my Response step then which will go back to my Powerapp?  The only option from my Apply_to_each is Current Item.

  • Pstork1 Profile Picture
    69,661 Most Valuable Professional on at

    You just use the Apply to each to find the right Index entry.  Use a condition to find the one that has a length > 0 and a counter for the index.  Then save the appropriate counter and use that in the following to get the results array to send back.

    body('Parse_JSON')?['value'][Index#]?['Result']

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

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Congratulations to the July Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
11manish Profile Picture

11manish 394 Super User 2026 Season 2

#2
Mohsin Ali Profile Picture

Mohsin Ali 328

#3
WarrenBelz Profile Picture

WarrenBelz 324 Most Valuable Professional

Last 30 days Overall leaderboard