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 / Possible to type out D...
Power Automate
Unanswered

Possible to type out Dyanmic Content?

(0) ShareShare
ReportReport
Posted on by 33

Hello, 

 

I'm very new to PowerAutomate so unsure of all it's capabilities. I'm curious if it's possible to type out Dynamic Content and use in a Apply to Each Action?

 

example: body('Parse_JSON')?['result']?['success']?['XXX-XXX']?['parameters']

 

Reason I ask is because I'm reading a JSON from an HTTP request. The JSON path unfortunately includes a variable that we push to the request but that means the Dynamic Content changes every request as well (ex: body('Parse_JSON')?['result']?['success']?['XXX-XXX']?['parameters']).

Seems like Power Automate doesn't change the path after every request; for example, if the first request uses '123-456' the Dynamic Content will include that '123-456' but if the next request we use '789-123' it doesn't work unless we go into the flow and remove the Dynamic Content and then re-add. 

 

I tried simply removing the Dynamic Content and then typing in the name (body('Parse_JSON')?['result']?['success']?['XXX-XXX']?['parameters']) in the Expression but it errored out with the following,

"The template validation failed: 'The repetition action(s) 'Apply_to_each' referenced by 'inputs' in action 'Select' are not defined in the template.'."

Jakeapril_0-1685471379318.png

 

Is this a possible feature inside Power Automate? Thank you!!

Categories:
I have the same question (0)
  • abm abm Profile Picture
    32,865 Most Valuable Professional on at

    Hi @Jakeapril 

     

    From the above my understanding is you have a HTTP request and the response values are dynamic. If you using Parse JSON schema it works with a fixed schema set. Do you know all the possible values returned from the HTTP request. The extend the schema with all the values. If you don't know the schema set and its fully dynamic its not possible to extract using Parse JSON step.

    Thanks

  • Jakeapril Profile Picture
    33 on at

    Hi @abm, thank you for the reply! And thanks for all the help you give on the forum, I've been learning a lot from your responses on other posts 😄

     

    Ah you may be right, I do not fully know the Schema set as it is dependent on what is returned from the HTTP request. I assume if you don't know the full Schema set, it's not possible to extract all data?

     

    For example, right now my Schema set is:

    {
     "type": "object",
     "properties": {
     "method": {
     "type": "string"
     },
     "result": {
     "type": "object",
     "properties": {
     "success": {
     "type": "object",
     "properties": {
     "f6710b99-302e-41a8-9e06-976ab06036f4": {
     "type": "object",
     "properties": {
     ....
     }
     }
     }
     }
     }
     }
     }
    }

    I can't just use the following, omitting the dynamic info in the schema...

    {
     "type": "object",
     "properties": {
     "method": {
     "type": "string"
     },
     "result": {
     "type": "object",
     "properties": {
     "success": {
     "type": "object",
     "properties": {
     ... missing info here ...
     }
     }
     }
     }
     }
    }

     

    I assume I can't use the above and still pull out that last "properties" data from the first code snippet?

     

    Thank you!

  • abm abm Profile Picture
    32,865 Most Valuable Professional on at

    Hi @Jakeapril 

     

    Thanks for your reply.

     

    Here is an example. 

     

    Sample Schema 1

     

    {

    "Name":"David",

    "Age":23,

    "PostCode":"LD3 4RT"

    }

     

    Here is another schema where Postcode is missing and new property called Employed is added.

     

    Sample Schema 2

     

    {

    "Name":"David",

    "Age":23,

    "Employed":"Yes"

    }

     

    So for the above you could generate a JSON schema like using the below data. Here I know all the possible outcome of the data in different situations.  Hence I generated the data manually and generated the Parse JSON schema.

     

    {

    "Name":"David",

    "Age":23,

    "PostCode":"LD3 4RT",

    "Employed":"Yes"

    }

     

    This way if the info is missing it will return you blank but you need to know the full combinations of the schema.

     

    Hope it make sense.

  • Verified answer
    Jakeapril Profile Picture
    33 on at

    Hi @abm

     

    Yes, what you're saying makes perfect sense! So it doesn't perfectly solve my issue because it's not that there could be many different properties but just one property with different names. But thanks for that idea, will add to my tool kit 😁

     

    I actually was able to figure out the answer to my question though, it IS possible to manually type out Dynamic Content. 

     

    I had an HTTP response that gave the following data...

    {

      "method": "fetch",
      "result": {
        "success": {
          "r6710a99-302r-42a8-9e04-944a406336a4": {
            "data": {

              .....

            }

          }

        }

      }

    }

     

    So the Schema for my Parse JSON had to look like the following...

    {
        "type""object",
        "properties": {
            "method": {
                "type""string"
            },
            "result": {
                "type""object",
                "properties": {
                    "success": {
                        "type""object",
                        "properties": {
                            "r6710a99-302r-42a8-9e04-944a406336a4": {
                                "type""object",
                                "properties": {
                                    "data": {
                                        ....
                                    }
                                }
                            }
                        }
                    }
                }
            }
        }
    }
     
    I was worried that since my "r6710a99-302r-42a8-9e04-944a406336a4" changes everytime, my schema will break. But looking at this stack overflow article, looks like it's still possible. 
     
    So I kept the schema and then did a compose right after using a text to describe my dynamic content,
    body('Parse_JSON')?['result']?['success']?['r6710a99-302r-42a8-9e04-944a406336a4']?['data']
    body('Parse_JSON')?['result']?['success']?[variables('inputID')]?['data']
     
    And it worked beautifully! Now when I inputted a new '#####-###...' it's flexible and dynamic!
  • abm abm Profile Picture
    32,865 Most Valuable Professional on at

    Hi @Jakeapril 

     

    That's good to hear. 

     

    So if you use question mark its optional.  If you don't use question mark between the properties then it expects that in the schema.

     

    body('Parse_JSON')?['result']?['success']?[variables('inputID')]?['data']

     

    Thanks for the update.

     

     

  • Jakeapril Profile Picture
    33 on at

    Ahh great knowledge. Will remove the ? since they are definitely required. 

     

    Thanks for the tip!

  • abm abm Profile Picture
    32,865 Most Valuable Professional on at

    If you really want to validate it then remove it or keep it.

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 522 Super User 2025 Season 2

#2
Tomac Profile Picture

Tomac 364 Moderator

#3
abm abm Profile Picture

abm abm 243 Most Valuable Professional

Last 30 days Overall leaderboard