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 / Convert object in requ...
Power Automate
Answered

Convert object in request to string

(0) ShareShare
ReportReport
Posted on by Microsoft Employee

I have a post api which takes input or request body as such:

{

"TempName":"123",

"TempInput":"{

  "User1":"mark",

  "User2":"trevor"

}"

}

The "user1" and "user2" are dynamic and I first fetch the schema using TempName(I do it using x-ms-dynamic-schema in th swagger and it works fine,IN FLOW it shows me two text boxes with labels "user1" and "user2" dynamically and i can enter mark and trevor in it;for some other TempName it could show different number of text boxes). Now, my request body becomes like:

{

"TempName":"123",

"TempInput":{

"user1":"mark",

"user2":"trevor"

}

}

I totally oversaw the two double quotes for TempInput's value actually required(that means it is taking a string and not object) and there is no option for me to create a string dynamically in my connector. So, is there a quick fix to convert the object to string and send it as TempInput?

Categories:
I have the same question (0)
  • ChristianAbata Profile Picture
    8,951 Most Valuable Professional on at

    hi @t-prrath  If I  understand well this is what you need, imagine that my output has your json result.

     

    string.PNG

    string(outputs('Compose'))
  • t-prrath Profile Picture
    Microsoft Employee on at

    Hey @ChristianAbata thanks for the reply but let me clarify; I'll put an image here:

    Z.png

    If you observe, this is my action in my custom connector: If i enter GDPR it shows me 5 boxes(dynamically): if i fill those and run the flow, the connector sends the request as 

    {

     "TempName":"GDPR",

     "TempInput":{

       "GDPR_Name":"mark",

       "GDPR_PostalAddress":"utopia",

       "GDPR_EmailAddress":"something@something.com",

    "GDPR_PhoneNumber":"0",

    "GDPR_ActionType":"do something"

      }

    }

    but the POST API actually expects that the TempInput be a string and not a JSON object; now I cant compromise on the UI; because I want my end user to fill his stuff in my connector's text boxes rather than fillin JSON in compose operation. So how do i workaround this? Do i change my api to accept JSON object or can  I use something I am missing IN THE FLOW itself ?

  • Verified answer
    ChristianAbata Profile Picture
    8,951 Most Valuable Professional on at

    ohh @t-prrath  I understhand, and my advide is change your API, to accept json, because everyting you manage here in PA is using Json languaje so change your API to accept objects is the best way. 😉

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

#2
Tomac Profile Picture

Tomac 323 Moderator

#3
abm abm Profile Picture

abm abm 237 Most Valuable Professional

Last 30 days Overall leaderboard