Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
Anonymous
Not applicable

Consulta API REST dinámica

Estoy tratando de replicar el siguiente método para implementar el plegado de consultas en el uso de service now rest API en power bi desktop

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

El servicio ahora codifica el parámetro date como este :-

sysparm_query-sys_created_on%3E%3Djavascript%3Ags.dateGenerate('2020-05-01'%2C'00%3A00%3A00')
ahora estoy recibiendo el error "Token Comma Expected" justo después de sys_created_on en la siguiente consulta

(dtquery como texto)->

Dejar

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

"Convertido a la tabla" - Table.FromList(Pagination, Splitter.SplitByNothing(), null, null, ExtraValues.Error)

En
"Convertido en tabla"

¿Qué pasa aquí?

3 REPLIES 3
Greg_Deckler
Super User
Super User

@User1201 - Le falta una coma después de la primera línea (Fuente)

(dtquery como texto)->

Dejar

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

"Convertido a la tabla" - Table.FromList(Pagination, Splitter.SplitByNothing(), null, null, ExtraValues.Error)

En
"Convertido en tabla"


@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
The Definitive Guide to Power Query (M)

DAX is easy, CALCULATE makes DAX hard...
Anonymous
Not applicable

@Greg_Deckler gracias por la respuesta, Mi consulta está devolviendo el mismo error incluso después de poner una coma como usted mencionó.

[Consulta-sysparm_query-sys_created_on%3E%3Djavascript%3Ags.dateGenerate('2020-05-01'%2C'00%3A00%3A00')])),

el valor rojo'%' es donde se muestra como "Token Comma Expected"

@User1201: está bastante seguro de que la sintaxis del parámetro Query está muy desactivada.

https://blog.crossjoin.co.uk/2016/08/16/using-the-relativepath-and-query-options-with-web-contents-i...


@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
The Definitive Guide to Power Query (M)

DAX is easy, CALCULATE makes DAX hard...

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.

Top Kudoed Authors