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 Automate / Help with filter query...
Power Automate
Unanswered

Help with filter query for a json body

(0) ShareShare
ReportReport
Posted on by 62

Hi

I'm trying to create a $filter for the "List Resources by Subscription" Azure Connector. The reason I need to filter this is because the results are more than 5000 and are getting paginated, and because of that I'm losing data.

 

However, no matter what I do, I get an "Invalid $filter"

 

According to documentation, List Resources by Subscription should return a ResourceListResult, with the following values

  Name Path Type Description

value
valuearray of GenericResource

The list of resources.

Next Link
nextLinkstring

The URL to get the next set of results.

 

This is the Schema autogenerated from the response:

 

{
 "type": "object",
 "properties": {
 "statusCode": {
 "type": "integer"
 },
 "headers": {
 "type": "object",
 "properties": {
 "Pragma": {
 "type": "string"
 },
 "x-ms-ratelimit-remaining-subscription-reads": {
 "type": "string"
 },
 "x-ms-request-id": {
 "type": "string"
 },
 "x-ms-correlation-request-id": {
 "type": "string"
 },
 "x-ms-routing-request-id": {
 "type": "string"
 },
 "Strict-Transport-Security": {
 "type": "string"
 },
 "X-Content-Type-Options": {
 "type": "string"
 },
 "Timing-Allow-Origin": {
 "type": "string"
 },
 "x-ms-apihub-cached-response": {
 "type": "string"
 },
 "Cache-Control": {
 "type": "string"
 },
 "Date": {
 "type": "string"
 },
 "Content-Length": {
 "type": "string"
 },
 "Content-Type": {
 "type": "string"
 },
 "Expires": {
 "type": "string"
 }
 }
 },
 "body": {
 "type": "object",
 "properties": {
 "value": {
 "type": "array",
 "items": {
 "type": "object",
 "properties": {
 "id": {
 "type": "string"
 },
 "name": {
 "type": "string"
 },
 "type": {
 "type": "string"
 },
 "location": {
 "type": "string"
 },
 "tags": {
 "type": "object",
 "properties": {
 "Application": {
 "type": "string"
 },
 "Team": {
 "type": "string"
 },
 "Environment": {
 "type": "string"
 }
 }
 },
 "sku": {
 "type": "object",
 "properties": {
 "name": {
 "type": "string"
 },
 "tier": {
 "type": "string"
 }
 }
 },
 "managedBy": {
 "type": "string"
 },
 "kind": {
 "type": "string"
 },
 "identity": {
 "type": "object",
 "properties": {
 "principalId": {
 "type": "string"
 },
 "tenantId": {
 "type": "string"
 },
 "type": {
 "type": "string"
 }
 }
 }
 },
 "required": [
 "id",
 "name",
 "type",
 "location"
 ]
 }
 },
 "nextLink": {
 "type": "string"
 }
 }
 }
 }
}

 

 

 

I want to filter by "type", where type equals a specific value.

Example:
type equals Microsoft.Compute/virtualMachines

 

I've tried (and failed):

 

type eq "value"

type eq 'value'

body/properties/value/items/properties/type eq value

properties/value/items/properties/type eq value

value/items/properties/type eq value

items/properties/type eq value

properties/type eq value

 

I'm running out of options and I don't know any other way of solving the pagination....

 

Categories:
  • Morke Profile Picture
    62 on at

    Ok so the problem happens only with the custom property "type", I suspect because JSON has types...

    I can't beleive Microsoft lets this happen...

     

    Any ideas on how do I specify that i'm using a field/column/property name and not a JSON reserved name like "type" or "name" ?

  • WillPage Profile Picture
    2,339 Super User 2026 Season 1 on at

    If you struggle to delegate your filter query to the API because of their odd choice of key name, you can pull all the results down and filter locally. I've written a blog article on handling pagination in the MS Graph API. I only wrote it yesterday so it's sort of lucky I found your question! https://willpagenz.wordpress.com/2020/05/26/handling-pagination-with-the-ms-graph-api-in-logic-apps-and-power-automate/

     

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

Leaderboard > Power Automate

#1
Mohsin Ali Profile Picture

Mohsin Ali 377

#2
11manish Profile Picture

11manish 302 Super User 2026 Season 2

#3
Henil Profile Picture

Henil 130

Last 30 days Overall leaderboard