cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
Dual Super User III
Dual Super User III

HTTP request: error filling body wth expressions

Hi!

I have the folowing problem:

 

I initialize an object variable as follows:

Name: Preload

Type: Object

Value:

{

"App": "Games",

"OEM": "@split(body('Get_item')?['DevicePreloadSlot']?['Value'],' | ')[0]",

"Model": "@split(body('Get_item')?['DevicePreloadSlot']?['Value'],' | ')[1]",

"OSVersion": "@split(body('Get_item')?['DevicePreloadSlot']?['Value'],' | ')[2]",

"Timestamp": "@split(body('Get_item')?['DevicePreloadSlot']?['Value'],' | ')[3]"

}

 

When I execute the flow, the variable gets the expected values, all object parameters are strings.

 

Then I add an HTTP request to invoke a second flow as follows:

Method: POST

Uri: https://prod-63.westeurope.logic.azure.com:443/...

Headers:

Body:

{

"DeviceModel": "@variables('Preload')?['Model']",

"OEM": "@variables('Preload')?['OEM']",

"OSVersion": "@variables('Preload')?['OSVersion']",

"DemoGames": "@variables('Games2PreloadString')"

}

 

 

However, once I save the Flow and re-edit it, the HTTP request definition is displayed as follows:

Method: POST

Uri: https://prod-63.westeurope.logic.azure.com:443/...

Headers:

Body:

{

"DeviceModel": "@variables('Preload')",

"OEM": "@variables('Preload')",

"OSVersion": "@variables('Preload')",

"DemoGames": "@variables('Games2PreloadString')"

}

 

When executing the flow, it does not behave as expected because "DeviceModel", "OEM" and "OSVersion" are assigned the whole 'Preload" object variable.

 

I guess this is a bug, right?

Thank you in advance!



Each time you click on any of our inspiring answers 'Thumb up' icon...
...an ewok scapes from the stormtroopers.

Be grateful, Thumbs up! Save the Galaxy for free!


Escribo sobre Power Automate en:
https://medium.com/anyone-can-automate/

Proud to be a Flownaut!



3 REPLIES 3
Highlighted
Community Support
Community Support

Re: HTTP request: error filling body wth expressions

Hi @ ,

 

Could you please share a screenshot of the configuration of your flow?

Do you have problem get the expected values from the variable "Preload"?

 

Please share more details about your flow so we would provide a proper workaround for you.

 

 

Regards,
Alice Zhang

Highlighted
Dual Super User III
Dual Super User III

Re: HTTP request: error filling body wth expressions

Hi again

Please find enclosed a screenshot of most of the service logic, I've marked in red the two blocks affected by the bug ("Initialize variable" and "HTTP request"). IF you need more details to reproduce it please let me know.

Games_error_flow.png

I've already found a workaround: just after object variable initialization, I have added a "Parse JSON" action block. 

Then on the "HTTP request" action block, I use the outputs of "Parse JSON" instead of expressions based on the object variable.

 

Anyway, I still think there is a bug on the editor when interpreting the original HTTP request body input: I cannot understand why the editor converts the expression

 

variables('Preload')?['Model']

 

into

 

variables('Preload')

 

once I save it, meaning the flow does not work as expected.

Thank you in advance!



Each time you click on any of our inspiring answers 'Thumb up' icon...
...an ewok scapes from the stormtroopers.

Be grateful, Thumbs up! Save the Galaxy for free!


Escribo sobre Power Automate en:
https://medium.com/anyone-can-automate/

Proud to be a Flownaut!



Highlighted
Dual Super User III
Dual Super User III

Re: HTTP request: error filling body wth expressions

Hi again

Here you are a more simplified flow, you will see in this screenshot much much better the problem I am reporting:

 

Games_error_flow_2.png

The data I originally added on HTTP request body input:

{

"DeviceModel": "@variables('Preload')?['Model']",

"OEM": "@variables('Preload')?['OEM']",

"OSVersion": "@variables('Preload')?['OSVersion']",

"DemoGames": "123"

}

 

The data displayed on HTTP request body input after Create Flow, exit, and Edit it again (I did not modified nothing, it is the editor):

{

"DeviceModel": "@variables('Preload')",

"OEM": "@variables('Preload')",

"OSVersion": "@variables('Preload')",

"DemoGames": "123"

}



Each time you click on any of our inspiring answers 'Thumb up' icon...
...an ewok scapes from the stormtroopers.

Be grateful, Thumbs up! Save the Galaxy for free!


Escribo sobre Power Automate en:
https://medium.com/anyone-can-automate/

Proud to be a Flownaut!



Helpful resources

Announcements
Community Conference

Power Platform Community Conference

Check out the on demand sessions that are available now!

Power Platform ISV Studio

Power Platform ISV Studio

ISV Studio is designed to become the go-to Power Platform destination for ISV’s to monitor & manage published applications.

Tech Marathon

Maratón de Soluciones de Negocio Microsoft

Una semana de contenido con +100 sesiones educativas, consultorios, +10 workshops Premium, Hackaton, EXPO, Networking Hall y mucho más!

Top Solution Authors
Users online (8,665)