Unable to get a particular element value from JSON object

webservice

#1

i watched “https://www.youtube.com/watch?time_continue=182&v=D_RkqNq5nzM” to get data from a web service and extract the of child element from the Json object (deserialized).

Using UIpath studio 2018.2.3


#2

Hi,

Which activity you have used to extract the data.

Use Deserialize Json or Deserialize Json Array.


#3

Hi - One sample example, this might help you.demo.xaml (6.0 KB)
project.json (303 Bytes)

Regards,
Nitesh


#4

i ran the demo.xaml again. but again i got the same error.


#5

used deserialiized json


#6

@nidhimishra

Use Deserialize Json Activity then assign the result to a variable of type Json Object.

Then You can acces the particular child by using the nodes like
Json Object Variable(“Child Node”)

Regards,
Mahesh


#7

I did the same thing.


#8

@nidhimishra

Have you Imported the Namespaces, NewtonSoft.Json, NewtonSoft.Json.Linq.
Import the namespaces and try once agin, lets see.

Regards,
Mahesh


#9

h

how to import?
Can you please explain the process


#10

@nidhimishra
In the bottom of your screen there will be a tab called Imports,

  1. Click on that
    2.Then type NewtonSoft.Json
    3.Then it will display the Namespace, you just select it

Regards,
Mahesh


#11

Mahesh i tried the imports as well, the error doesnot seem to go away.


#12

@nidhimishra

Can you post here your xaml and the JSON String.

Regards,
Mahesh


#13

the api is https://api.genderize.io/?name=peter and want to extract name data from the Json object created.

Main 1.1.xaml (8.7 KB)

thanks


#14

@nidhimishra

Its working fine in my system.

Regards,
Mahesh


#15

Hi @nidhimishra- Try this out.demo.xaml (6.9 KB)

Regards,
Nitesh


#16

@nidhimishra Its working fine for me also you can check attached file i changed to get all the values

Main_Api.xaml (10.1 KB)


Downloading JSON from Web and getting data to datable
How to read/write xml /json in uipath
#17

i tried both the .xaml files… but the error doesnot seem to go away… the same error persists.
This workflow seems to work fine on 2017 version of studio in my pc but the following workflow doesnot seem to work on 2017 version as the workflow involves “lookup datatable” activity, its not present in the 2017 version.

Please help.


#18

Hi this error now exists for some particular Urls only… the error which i face now are below

5

Properties of Deserialize Json Activity
6