Json update from Excel data


use the write text file activity
fileContent: give try on myJObject.toString

Thank you… Just one more question am trying to write the json to a web application using type into (which requires the data to be in string ) but when I do that ,the in the existing json file is not being populated and it types the data without the .
please suggest.

please reformat your post. It is not clear what is meant and what is the issue. Maybe you illustrate with some screenshots e.g. from immediate panel related to what is received and whar is expected. Thanks

For example the jsonoject is as shown below :
“Name”: “fghijkl”
“Age” : “12”
“Location”: “vbnmzxc”
“Timezone”: “cst”}
When I use “Type Into activity” ,since it takes only string value ,i used jsonobject.string and the final string what gets typed in a particular form of a web application looks like the below:
Name”: “fghijkl”
“Age” : “12”
“check”: “a”,“b”,“c”,“d”
“Location”: “vbnmzxc”
“Timezone”: “cst”}
So at [“abcdefgh”] and [“a”,“b”,“c”,“d”] of Keys “Creation” and “check” is omitted in the form.

in such a case we would recommend following (sure, we do it by debugging)

  • what is in Excel for replacement value
  • how does it looks, after updating - myJObject.toString within immediate panel

when all is correct but issue is still present, then share a screenshot of the textbox after the type into was executed

I put myJObject.ToString in the TypeInto activity indicating the screen where the type has to happen.
It does type in correctly but the json file doesn’t have the .
Please check the actual json in pic and the string which gets typed in another pic.
Uploading: IMG_20220121_143004__01__01.jpg…

The is missing

Let’s do one thing:

  • limiting the scope of this topic only on updating JSON by values from EXCEL
  • formal close this topic by procedure from below as the updating (we can check with myJObject.toString) was working. Other researchers will easier identify case-solution when we do so

Conclusion: with the values from an Excel along with a Key, Path mapping config we can flexible implement this case.

Closing a topic:
Forum FAQ - How to mark a post as a solution - News / Tutorials - UiPath Community Forum

We will work on this new case (type into - webpage) on this other topic:

Kindly note:

  • we can see all pictures. Maybe you can share again with us on the topic. Thanks

I was just verifying the invoke method,the values are converted to String.
After the Invoke Method,when I just put in a Log Message to see the Json data, it does not have the in it…
I tried the XAML shared by you with few modifications in the json file.

Any update would be helpful?

was answering on the other topic. Please do not mismatch both.

Sure… Ok I wanted to know with the XAML you shared in this question, I made few changes to the json file as shown in the previous comment for this topic, when I execute the xaml the myJObject after the Invoke method doesnt have the in it as well…
Please see the output below:

have a look here:

in the path, we have configured to update the first Array Item and the Array is kept.

Maybe the origin Array was wrongly replaced by a new JToken as a simple value. But all these things are identifiable by debugging

I did try this and I get the below

Please find the XAML file and json file(data1.json) which i am using.
I had to remove the file path.
JSONUpdate_FromExcel_ByPathMapConfig.xaml (15.0 KB)
data.json (117 Bytes)

Please check and let me know.

Any suggestion would be helpful…

Currently im Traveling and away from Laptop. However read again above where the Array Item Access IS mentioned. WE do feel, that you dont have Arrays as the jton replace will Set a String only as value

Maybe you can modify IT by Ur own

I tried to analyse the issue but wasn’t able to identify the issue and sort it out…

Had reviewed your XAML and it was running including the myJObject.toString statement

as mentioned here:

timezone placeholder value (a JArray) is replaced by a string. So we dont have a JArray anymore. we can clearly see here:

so also later when it is entered the type into is not removing any [ character, as there are no JArrays.

Also it was elaborated already on how to handle here:

We would recommend to decide what is needed and then select the corresponding approach for the implementation

I understood that the JArray in myJObject are converted to string as well.
But we do want to retain the JArray the way it is and have the around the array items.
Would that be possible to do ?

we told you already above.

Have a look on how the dtMapping was changed to configure the update of the first array item.

Kindly note: a replace value = Time,Minutes will not replace as a JArray. It is just a simple string of two words seperated by a comma
Please read again carefully the posts as all on this was already elaborated.