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

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
Anonymous
Not applicable

Help creating dynamic parameters for power query

Hi all, 

Need help in creating a dynamic parameter to my query in power bi query as below:

(dtquery as text) =>
let
url="https://<instance>.xxx.com/api/now/table/incident?sysparm_display_value=true&sysparm_exclude_reference_link=true&sysparm_limit=1&sysparm_query=sys_created_onSTARTSWITH2020-07-08",
Source = Json.Document(Web.Contents(url,[Query=sysparm_query&"="&sys_created_on&STARTSWITH&dtquery]))

 

But I am getting this error :

An error occurred in the ‘’ query. Expression.Error: The name 'sysparm_query' wasn't recognized. Make sure it's spelled correctly.

 

Not sure what am I doing wrong here

2 REPLIES 2
Mariusz
Community Champion
Community Champion

Hi @Anonymous 

 

So there is a clear indication that the below part is wrong.

[Query=sysparm_query&"="&sys_created_on&STARTSWITH&dtquery]
most probably you have not defined sysparm_query anywrer in power query.

 

Best Regards,
Mariusz

If this post helps, then please consider Accepting it as the solution.

Please feel free to connect with me.
LinkedIn

 

Anonymous
Not applicable

@Mariusz Thanks for your reply, But if you see my URL I am actually using the parameter in the query:

 

(dtquery as text) =>
let
url="https://<instance>.xxx.com/api/now/table/incident?sysparm_display_value=true&sysparm_exclude_reference_link=true&sysparm_limit=1&sysparm_query=sys_created_onSTARTSWITH2020-07-08",
Source = Json.Document(Web.Contents(url,[Query=sysparm_query&"="&sys_created_on&STARTSWITH&dtquery]))

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

December 2025 Power BI Update Carousel

Power BI Monthly Update - December 2025

Check out the December 2025 Power BI Holiday Recap!

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.