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

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Automate / Dynamic Values in Filt...
Power Automate
Unanswered

Dynamic Values in Filter Array Source From

(0) ShareShare
ReportReport
Posted on by 54

I am working with a JSON response that I need to query but the objects change (data types do not). In the example below, "2022-11-21:2" and "330.0" change all the time.

 

{
   "2022-11-21:2": {  
          "330.0": [{
                  "Field1": "TEST",
                   "Field2": "TEST"
           }],
            "333.0": [{
                   "Field1": "TEST",
                    "Field2": "TEST"
           }]
     }
}

 

So, I need to build an expression along the lines of:  body('Test')?['2022-11-21:2']?['330.0']

 

My question is...how do I include dynamic values in the expression? Or, is this not the best approach to parsing/querying the JSON?

Categories:
I have the same question (0)
  • grantjenkins Profile Picture
    11,063 Moderator on at

    That's some very strange JSON output you're getting there 😕

     

    What are you trying to get as final output? Will you be outputting just the values of the Field elements, or will you still be wanting to output "2022-11-21:2" and "330.0" as well?

     

    If you can give us an example of what you'd like to see at the end, then we can work backwards to get what you're after.

  • IFEJohn Profile Picture
    54 on at

    Thank you for your response. Ha, I know it's strange...but the response of an API I don't have control over. My final output will be values of field elements. But I cannot simply reference array number...need to reference the specific "330" or "333"...which could be any number.

  • grantjenkins Profile Picture
    11,063 Moderator on at

    Is this the sort of output you were expecting? Or something else?

     

    [
     {
     "Field 1": "One",
     "Field 2": "Two"
     },
     {
     "Field 1": "Three",
     "Field 2": "Four"
     }
    ]

     

    The last thing I'm having trouble with is the single colon : within 2022-11-21:2.

  • IFEJohn Profile Picture
    54 on at

    Thank you @grantjenkins. I actually just need...

     

     

    {
     "Field 1": "One",
     "Field 2": "Two"
    }

     

     

     Yeah, that colon is a tricky part. It seems to be an array sequence number of some sort...strange usage.

  • grantjenkins Profile Picture
    11,063 Moderator on at

    Just confirming - I'm assuming even the 2 after the colon could change to something else:

    "2022-11-21:2

  • IFEJohn Profile Picture
    54 on at

    Yes, that value can change too, unfortunately. It is some kind of sequence number.

  • Ajinder31 Profile Picture
    530 on at

    @IFEJohn May we know if this response is from a Custom connector or existing published connectors? If it's from custom connector then do you have edit access to the connector.

    The reason I am asking because I worked with similar scenario while working on a custom connector and Policy Object to Array helped me in my case. 

  • IFEJohn Profile Picture
    54 on at

    It’s the response from an API call using the HTTP connector. 

  • Ajinder31 Profile Picture
    530 on at

    Hi @IFEJohn , I think we can go Custom connector route in this case as Http also requires a premium license (as per my knowledge). Custom connector also gives us the flexibility to transform response as required using custom code as well. 

    At the same time, there might be better solution available which I am not aware of. 

  • grantjenkins Profile Picture
    11,063 Moderator on at

    I think I've got that rouge colon sorted. Just wanted to confirm a couple more things.

     

    What will the field names be? At the moment you have Field1 and Field2, but what are some of the actual field names (or are those them)?

     

    And will the field names always be the same?

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
Michael E. Gernaey Profile Picture

Michael E. Gernaey 525 Super User 2025 Season 2

#2
Tomac Profile Picture

Tomac 324 Moderator

#3
abm abm Profile Picture

abm abm 232 Most Valuable Professional

Last 30 days Overall leaderboard