Web automation

uiautomation

#1

Hi All,
I made an API call with http request activity. The json result returned comes saved in a variable. What i mean is that the response returned is saved in a variable as shown below:

var response = {json object} — this is how it is returned.

How do i view the response since it comes saved in a variable?


#2

Hey @Olaoluwa

Here are two sample i am attaching for your reference.
One sample deal with simple json data.
Second sample deal with json array data.

Sample1.xaml (6.6 KB)
Sample2.xaml (7.5 KB)

Let me know in case of any issue.

Regards…!!
AKsh


Convert JArray to String
Json Extract one specific element
#3

I totally understand what you sent but thats not the problem i am having. The json response from the apic call is returned like this:
var response = {“Expense”:[{“Has_the_expense_been_entered_in_sheet?”:“Yes”,“Client_Not_In_Good_Standing”:true,“Client_Name”:“Bishop”,“TotalAttestSelected”:0,“File_upload1”:“http://creator.zoho.com/DownloadFile",“Last_4_digits_of_CC_used_to_pay_expense”:456,“Sufficient_in_Trust”:false,“Expense_Description”:"Estate Real”,“File_upload2”:“http://creator.zoho.com/DownloadFile",“Expense_Amount”:"$ 12.57”,“Check”:"",“Tran_Indicator”:“I”,“Uploaded”:false,“Expense_Management_Approval_Required”:false,“Authorizing_Attorney”:“Braham”,“How_was_the_expense_paid”:“With cash”,“Accounting_Notes”:"",“Management_Approved”:false,"

Thats the response from the api call. Now how do i access Expense itself since it holds the important information.


#4

Where i have used id with getvalue replace that with your word and it is a single array so check sample 1 :slight_smile: just replace the word with your response and url.


#5

It kepps giving this error

Deserialize json : Unexpected character encountered while parsing value: v. Path ‘’, line 0, position 0.


#6

Once you got the json in variable please refer the below tutorials,

Part1:

Part 2:

Thanks,
Karthik.