KamKam
(KamKam)
January 27, 2020, 10:44am
1
Hi guys!
I am trying to use the Deserialize JSON activity but I get the error shown in the title of this posts title.
I post POST an API call using the HTTP request activity. When I write line the Result I get the following: {“Message”:“Message Sent”,“Success”:true}
When I put this in the Deserialize JSON activity I get the error.
I’d be grateful for any help here.
arivu96
(Arivazhagan A)
January 27, 2020, 10:53am
2
Hi @KamKam , can you please send the error screenshot, look like valid json format only.
Hi
This looks fine
Where any special characters like doubles were mentioned before and after this string
Like this
“{“Message”:“Message Sent”,“Success”:true}”
If so remove that and keep only this
{“Message”:“Message Sent”,“Success”:true} In a string variable or in a text file which can be read from a text with READ TEXT FILE ACTIVITY
Cheers @KamKam
1 Like
KamKam
(KamKam)
January 27, 2020, 11:52am
4
Not when I put the Result from the HTTP Request activity into the Write Line activity.
In the Locals when I use the debugger it gives me: “{"Message":"Message Sent","Success":true}”
Should I be concerned by the fact that what was given something different in Locals compared to when I use the write line?
no its fine as what came with Locals as it tries to represent it as a string
so assign this in a string variable like this with a assign activity
str_inJson = “{“Message”:“Message Sent”,“Success”:true}”
then pass this as input to Deserialize JSON activity
Cheers @KamKam
GBK
(GBK)
January 27, 2020, 12:14pm
7
Provided json is not having any format related issues.
Are you inputting the json text in to deserialize json activity?
like how we did this
can i have a screenshot of it
@KamKam
KamKam
(KamKam)
January 27, 2020, 12:46pm
11
Yes, I am. But it is still giving me the same error.
GBK
(GBK)
January 27, 2020, 12:48pm
12
Maybe the result is having a hidden special characters at the begin/end. Do the trim and verify.
Regex.Unescape
@KamKam
bcorrea
(Bruno Correa)
January 27, 2020, 7:32pm
14
if the only thing you need from the result is to know if it was successful or not and you having all this trouble, then just use a String.contains
KamKam
(KamKam)
January 28, 2020, 4:44am
15
Restarting my PC and doing the same process in a different Studio instance worked
system
(system)
Closed
January 31, 2020, 4:45am
16
This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.