Forum Discussion
API REST - GET - DataFormat.Error: We found an unexpected character in the JSON input.
- Anonymous5 years ago
Hi!
We found a workaround for this parsing problem. We used the sysparm_fields to get just the columns that were needed. This way we could retrieve all the lines of the table.
let
Source = Json.Document(Web.Contents("https: //YYYYYYYYYYY .service-now. com/api/now/ table/tablename?sysparm_fields= column1,column2,column3,column4,column5"))
in
SourceNo problem was found getting all the columns in separated groups.
Unfortunately, it's still unknown why it returns a parsing problem when I try to retrieve all the columns without specifying them.
What is the "65001" in the Json.Document function? Do you get a json doc with just the Web.Contents part? See what you get and then open it with the right function. You may need to specify json format in the web call.
Regards,
Pat
- Anonymous5 years agoNot applicable
hello mahoneypat !
Thanks for you time and help!The "65001" is related to UTF-8 encoding. But it's not necessary due to the GET method from Servicenow brings back automatically the UTF-8 encoding.
When I tried to get the data only through Web.Content it returns a JSON document which I can't parse after it.
Parse by text, returns a limited amount of data and Parse by JSON returns the problem with DataFormat.Error thing.
Regards,
Kendi