Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
6 years ago

Dynamic REST api query

I am trying to replicate the below method to implementing query folding in using service now rest API in power bi desktop

https://sqldusty.com/2020/05/20/power-bi-incremental-refresh-with-web-api-data-source/

 

Service now encodes the date parameter like this :-

sysparm_query=sys_created_on%3E%3Djavascript%3Ags.dateGenerate('2020-05-01'%2C'00%3A00%3A00')
now I am getting the "Token Comma Expected" error just after sys_created_on in the query below
 

(dtquery as text)=>

let

Source= Json.Document(Web.Contents("https://servicecentral.xxx.com/api/now/table/prolem",
[Query=sysparm_query=sys_created_on%3E%3Djavascript%3Ags.dateGenerate(dtquery)]))

#"Converted to Table" = Table.FromList(Pagination, Splitter.SplitByNothing(), null, null, ExtraValues.Error)

in
#"Converted to Table"

what is wrong here?

 

 

3 Replies