Forum Discussion
Ya I hit the request and it is giving internal server problem because the data which i got from Datasource is not in json format. So it is showing internal server problem. The value from datasource is coming as "ab_5ab5ab5OtherLow". Can you help me how to convert this value to json.
I need json like below
[{
"tcId":"ab_5",
"tcName":"ab5",
"tcDesc":"ab5",
"tcType":"Other",
"tcPriority":"Low"
}]
I am getting value from Datasource like "ab_5ab5ab5OtherLow". Please tell me how to convert this to my required json format.
Thanks & Regards,
Gangadhar
Find below raw attachment.
- Gangadhar8 years agoOccasional Contributor
Hi Rao,
Please try to provide the solution. I need it. Please find the raw request attachment.
Thanks & Regards,
Gangadhar Badagi
- Gangadhar8 years agoOccasional Contributor
Can you please advise how to take a list of values (e.g. in Excel) and then convert that to json array. I am getting values from excel in DataSource but I am unable to convert those values to json in request body editor.. Please find the attachments. in request body I need json like below
[
{
"tcId":"ab1",
"tcName":"ab1",
"tcDesc":"abc1",
"tcType":"Other",
"tcPriority":"Low"
}]
Can anybody help me to get json body as above?
Thanks & Regards,
Gangadhar Badagi
- zsousa8 years agoContributor
Gangadhar, the approach I took is not to build the JSON string on the fly, which can get tricky. Instead what I did is provide teh JSON string in my excel file and using place holders for the values. for instance:
so in my excel what I have is 5 columns,
column name tcId tcName requestcolumn value 1234 test1 [{"tcId":"<tcId>","tcName":"<tcName>","tcDesc":"<tcDesc>","tcType":"<tcType>","tcPriority":"<tcProperity>"}]
so basically what I do is go through each variable inside <> and replace it with the value under each column.
[
{
"tcId":"<tcId>",
"tcName":"<tcName>",
"tcDesc":"<tcDesc>",
"tcType":"<tcType>",
"tcPriority":"<tcProperity>"
}]
Related Content
- 3 years agoprasath_2k
- 6 months agomacheshmeh