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?
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. 😉
Hey @ChristianAbata thanks for the reply but let me clarify; I'll put an image here:
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 ?
hi @t-prrath If I understand well this is what you need, imagine that my output has your json result.
string(outputs('Compose'))
WarrenBelz
146,743
Most Valuable Professional
RandyHayes
76,287
Super User 2024 Season 1
Pstork1
66,089
Most Valuable Professional