How to send json body to Http request activity in studio

Hi, I am a newbie to UiPath . I want to send json body to Https request.
I have tried few ways but nothing seems to be working.

“{‘sk’: '”+row(“sk”).ToString+“',‘form’: '”+row(“form”).ToString+“',‘category1’: '”+row(“category1”).ToString+“', ‘mandatedDays’: '”+row(“mandatedDays”).ToString+“',‘category2’: '”+row(“category2”).ToString+“',‘country’: '”+row(“country”).ToString+“‘,‘name’:’”+row(“name”).ToString+“'}”

Studio doesn’t seem to give any error for the above format but the api endpoint that I am calling is not accepting the key value pairs with single quotes.

It would be great if I could get an example on this

@Supreetha_Achar Can you try something in this way and check:


1 Like

Hi @Supreetha_Achar welcome to forum

Check this way of adding the json data

hope it helps


Nived N

The character escaping is very important when passing the JSON as showed by @supermanPunch, in the example.

This solution works absolutely fine when the value is not dynamic.
I am trying to get the value from a csv file as row(“row1”).ToString
That’s where I am facing the issue

@Supreetha_Achar Can you try using the variable in this way :

You could try and create the json as a jobject then in the body field of the Http activity add the jobject as


This works for me and then you can update the fields of the jobject dynamically. To create the jobject you can use the deserialize activity on a string variable. Once jobject is created you can update properties with an assign activity

jobject(“property”) = NewValue

To avoid the confusion of the many escape chars, you could create a separeted template of your json with some placeholder or string format and replace them on execution time.

  1. Create a file, can be a txt or json file:


The {0} indicates that would the place that will be replaced when using String.Format

  1. Use read txt file activity, then you’ll have a string var.

  2. Replace the variables:

String.Format(stringGeneratedFromReadFileActivity, {“value”})

Now you have: {“key”:“value”}.

  1. Convert it to JObject using: Newtonsoft.Json.Linq.JObject.Parse(stringGeneratedFromReadFileActivity)

  2. Try to pass your jobject as string: newJObjectVar.ToString

Maybe not the most performatic way to do it, but it could help you to avoid a headache with escape chars.

Hello Supreetha,
In this video I work with complex JSON maybe you see what can e wrong on your side:

Cristian Negulescu

Update: Much faster and simple way to build JSON:

1 Like