How to file type

how to read a .json file

Hi @manoj_verma1

You can use Deserialize-json activity to read the file

Check out the XAML file

https://docs.uipath.com/activities/docs/deserialize-json

Hi,

First read json file using ReadTextFile activty.

Next deserialize json string to json object using Deserialize Json activity.

It’s necessary to install WebApi package to use DeserializeJson actiivty from MangePackage.

Regards,

@Yoichi @Gokul001
“{
‘fruit’: ‘Apple’,
‘size’: ‘Large’,
‘color’: ‘Red’
}”

how can i update size and color as large and red keeps changing

Hi,

Hope the following sample helps you.

Sequence.xaml (6.0 KB)

Regards,

1 Like

@Yoichi if i am reading saving back in same .json file how to do that

Hi,

Can you try WriteTextFile activity as the following?

Sample20221215-6.zip (2.5 KB)

Regards,

@Yoichi

api is this

{
“store”: [
{
‘fruit’: ‘Apple’,
‘size’: ‘Large’,
‘color’: ‘Red’
QTY: [
]
{
}
}}

Hi,

The above seems invalid json format. Can you share whole the json string as txt file?

Regards,

removedd…
removed

Hi,

If you need update Id, the following will work.

Sample20221215-6v2.zip (4.3 KB)

Regards,

@Yoichi what i need to do to update endid , sku

Hi,

Give it a try

image

Jo("Store")(0)("enduser")(0)("endId")="999"
Jo("Store")(0)("enduser")(0)("Pro")(0)("sku")="Orange"

Sample20221215-6v3.zip (3.3 KB)

Regards,

1 Like

Hi,

Can you clarify your expected output?

Regards,

@Yoichi is there any way that we can find out how many end user are there ?
Jo(“Store”)(0)(“enduser”)(4)(“endId”)=“999”

ex. (“enduser”)(4)

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.