Hi Team ,
I want to post data in Jason format using Http request in body parameter .
I have sent data successfully while hard code the value/query in body .
“{”“RFC_Dest”“: “””+in_Dest+“”“,”“Action”“: ““Double transmission is possible””}”
Response :-201 .
Unable to send the data using same query need to read value from asset .
Can some one please help on this .How we can post the data using http request in body from Asset value .
ppr
(Peter Preuss)
August 1, 2022, 7:52am
2
let us summarize our understanding.
the hardcoded JSON string was working
then you moved the string to an asset, but it is failing
rigth?
ensure that you handle properly the variable substitution. It cannot be done, when the same string is stored as string value on the asset.
Maybe following will work
Asset Value: {{'RFC_Dest': '{0}' , 'Action': 'Double transmission is possible'}}
Statement for the Body Field:
String.Format(in_Config("Query").toString, in_Dest)
I tried to with above solution but facing some issue .
.
Can you please guide on this peter
Thanks .
ppr
(Peter Preuss)
August 1, 2022, 11:05am
4
we would suggest to set a breakpoint and debug it. Once you get paused then use the immediate panel and prototype it
Understanding the 6 Debugging Panels of UiPath in the easiest way possible! - News / Tutorials - UiPath Community Forum
it looks that some variables / parameters are missmatched, but all can bechedked and tested within the debugging session
Hi peter,
I have tried in multiple always but doesn’t help .
Can you please help .
Thanks ,
Suresh
ppr
(Peter Preuss)
August 1, 2022, 5:08pm
6
just show us the immediate panel output from the different variables and its values which are involved when setting up the String.Format(… line
ppr
(Peter Preuss)
August 2, 2022, 8:24am
8
we would recommend:
Check on all scopes that there are not multiple variables with the same name (strqueryvalue)
Do in the tests within the immediate panel each test and do it complete
we miss here:
String.Format(Str_Query, Action)
in_Config(“HTTPRequestBody”).toString
String.Format(in_Config(“HTTPRequestBody”).toString, Action)
Also, we would recommend:
do clean up and remove all unneeded vars (e.g Str_Query) when it is not used e.g. within String.Format
instead of creating variables/logs, … do the inspections consequently within the immediate panels.
It looks like there is only a small confusion within your code and that you are close to having it done.
Feel free to share your XAML with us
Pl find the XAML file .
Can you please check peter .
Main.zip (2.0 KB)
Thanks ,
Suresh.T
ppr
(Peter Preuss)
August 3, 2022, 8:30am
10
@Thumu_Suresh
perfect that you isolated the issue
we need to escape { } when we need it as char in the pattern text
"{{'RFC_Dest':'{0}' , 'Action': 'Double transmission is possible'}}"
Now it is working Peter .
Thanks for the help…!!!
system
(system)
Closed
August 6, 2022, 9:46am
12
This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.