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

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
Community Support Team
Community Support Team

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

Dual Super User
Dual Super User

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!



Dual Super User
Dual Super User

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
firstImage

New Ranks and Rank Icons in April

Read the announcement for more information!

firstImage

Better Together Contest Finalists Announced!

Congrats to the finalists of our ‘Better Together’-themed T-shirt design contest! Click for the top entries.

firstImage

New & Improved Power Automate Community Cookbook

We've updated and improved the layout and uploading format of the Power Automate Cookbook!

thirdimage

Power Automate Community User Group Member Badge

Fill out a quick form to claim your user group badge now!

sixthImage

Community Summit North America

The top training and networking event across the globe for Microsoft Business Applications

Users online (8,127)