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 Automate - Building Flows
Answered

Filter from Json and apply to each

(0) ShareShare
ReportReport
Posted on by

Hi ,

I have a flow that collect sites from SharePoint online using microsoft graph
PowerAutomate1.png

The output is going to Parse Json and the schema is

 

{
 "type": "object",
 "properties": {
 "body": {
 "type": "object",
 "properties": {
 "value": {
 "type": "array",
 "items": {
 "type": "object",
 "properties": {
 "createdDateTime": {
 "type": "string"
 },
 "id": {
 "type": "string"
 },
 "name": {
 "type": "string"
 },
 "webUrl": {
 "type": "string"
 },
 "displayName": {
 "type": "string"
 },
 "isPersonalSite": {
 "type": "boolean"
 },
 "siteCollection": {
 "type": "object",
 "properties": {
 "hostname": {
 "type": "string"
 }
 }
 },
 "root": {
 "type": "object",
 "properties": {}
 }
 },
 "required": [
 "createdDateTime",
 "id",
 "name",
 "webUrl",
 "displayName",
 "isPersonalSite",
 "siteCollection",
 "root"
 ]
 }
 }
 }
 }
 }
}

 

 

The compose action is
PowerAutomate2.png

 

Since there is a lot of Output, I do not want the Onedrive accounts. I want to use the filter function and filter on
isPersonalSite equal to false
PowerAutomate3.png

When i am using the filter function, I can see the input bot the output is body[] - I am stuck on this filtering
After the filtering i want to take the Output from this filter and use a apply to each for checking the subsites on SharePoint
PowerAutomate4.png

Can someone help to guide me trhough the filtering and am I thinking right abot the apply to each where i am going to use the filtering an the id of the filtering

 

 

I have the same question (0)
  • ManishSolanki Profile Picture
    15,089 Super User 2025 Season 2 on at
    Re: Filter from Json and apply to each

    Hi @vidarv 

     

    In Filter array action, instead of entering false as text, pls try adding it as an expression to make it compatible with left side operand as shown below:

    ManishSolanki_0-1708266568746.png

     

     

    If this helps & solves your problem, please remember to give a 👍 and accept my solution as it will help others in the future.

     

  • vidarv Profile Picture
    on at
    Re: Filter from Json and apply to each

    Thank you for answering @ManishSolanki I am sorry but the output is still

     

    {
     "body": []
    }



     

  • Nived_Nambiar Profile Picture
    18,029 Super User 2025 Season 2 on at
    Re: Filter from Json and apply to each

    Hi @vidarv 

     

    I think the error is due to usage of array() function over parse json output 🤔

    Nived_Nambiar_0-1708268688297.png

     

     

    Based on schema i tried to generate a sample json object 

    {
     "body": {
     "value": [
     {
     "createdDateTime": "2024-02-18T08:00:00Z",
     "id": "123456789",
     "name": "example",
     "webUrl": "https://example.com",
     "displayName": "Example Site",
     "isPersonalSite": true,
     "siteCollection": {
     "hostname": "example.com"
     },
     "root": {}
     },
     {
     "createdDateTime": "2024-02-17T08:00:00Z",
     "id": "987654321",
     "name": "test",
     "webUrl": "https://test.com",
     "displayName": "Test Site",
     "isPersonalSite": false,
     "siteCollection": {
     "hostname": "test.com"
     },
     "root": {}
     }
     ]
     }
    }
    

     

    Now i tried to do same as you tried (for mocking the api part, i just kept the given JSON object in compose and then used it in Parse JSON )

    Nived_Nambiar_1-1708268903962.png

     

    Nived_Nambiar_2-1708268932409.png

     

    Nived_Nambiar_3-1708269076559.png

     

    Hope this helps !

    Thanks & Regards,

    Nived N 🚀

    LinkedIn: Nived N's LinkedIn
    YouTube: Nived N's YouTube Channel

    🔍 Found my answer helpful? Please consider marking it as the solution!
    Your appreciation keeps me motivated. Thank you! 🙌

     

  • vidarv Profile Picture
    on at
    Re: Filter from Json and apply to each

    Thank you for answering @Nived_Nambiar I am sorry but i got the following error

    The 'from' property value in the 'query' action inputs is of type 'Null'. The value must be an array.
  • Nived_Nambiar Profile Picture
    18,029 Super User 2025 Season 2 on at
    Re: Filter from Json and apply to each

    Hi @vidarv 

     

    Have you checked whether the output of http get request action, 

     

    Also show how you have designed the flow ?

     

    Thanks & Regards,

    Nived N 🚀

    LinkedIn: Nived N's LinkedIn
    YouTube: Nived N's YouTube Channel

    🔍 Found my answer helpful? Please consider marking it as the solution!
    Your appreciation keeps me motivated. Thank you! 🙌

  • vidarv Profile Picture
    on at
    Re: Filter from Json and apply to each

    Hi @Nived_Nambiar 
    Yes there are Output from http request that showes up in the parse json output,  or was there something else you where thinking. I have showe the flow in pictures, but here are a overview. Http request are using microsoft graph and behind is a api with fill application rights
    PowerAutomate5.png

  • ManishSolanki Profile Picture
    15,089 Super User 2025 Season 2 on at
    Re: Filter from Json and apply to each

    Hi @vidarv 

     

    Pls update the expression used in Compose action, try this one:

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

     

     

    If this helps & solves your problem, please remember to give a 👍 and accept my solution as it will help others in the future.

     

  • S-Venkadesh Profile Picture
    755 Moderator on at
    Re: Filter from Json and apply to each

    Hi @vidarv ,

    I've tested your use case, and it works successfully for me.
    Please follow the steps outlined in the snapshot:

    SVenkadesh_1-1708275610240.png

    I hope this information is helpful. If it is, please consider giving a thumbs up 👍.

    Best regards,
    Venkadesh Sundaramurthy

  • Verified answer
    vidarv Profile Picture
    on at
    Re: Filter from Json and apply to each

    Thank you for answering @ManishSolanki @S-Venkadesh 
    In my compose i set

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

    and in the Filter array from i used

    outputs('Compose')

    Both of the soloutions work 🙂
    Out of this I got 19500 records instead of 49 000. Any suggestion of how to use apply to each of the filter tu run the http throug every id to get subsites ?

  • S-Venkadesh Profile Picture
    755 Moderator on at
    Re: Filter from Json and apply to each

    Hi @vidarv 
    You can Extend the flow by adding another HTTP action with below endpoint to retrieve the subsites
    GET https://graph.microsoft.com/v1.0/sites/{site-id}/sites
    Sample Screenshot:

    SVenkadesh_0-1708278616162.png

    I hope this information is helpful. If it is, please consider giving a thumbs up 👍.

    Best regards,
    Venkadesh Sundaramurthy

     

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

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Chiara Carbone – Community Spotlight

We are honored to recognize Chiara Carbone as our Community Spotlight for November…

Leaderboard > Power Automate

#1
Michael E. Gernaey Profile Picture

Michael E. Gernaey 788 Super User 2025 Season 2

#2
Tomac Profile Picture

Tomac 452 Moderator

#3
developerAJ Profile Picture

developerAJ 302

Last 30 days Overall leaderboard