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

July 7 - July 17 | Round 2 of the Power BI Dataviz World Championships. Don't miss your chance! Learn more

Reply
Anonymous
Not applicable

Inconsistent handling of a string parameter within Web.Contents() Options record

I am trying to use a text parameter to set the key of a key: value pair within an Options record that gets used in Web.Contents(). The use case aside, the key of the key: value pair will not accept the parameter value but instead comes through as the parameter name. The value, however, comes through as the parameter value.

Here's a look at the variable set as the parameter value, getting passed into the Options record. Then, in the next image, the output parsed as Text.

 

Can anyone explain why this is happening or confirm that this is a bug?

 

darrenfishell_1-1629302831935.pngdarrenfishell_2-1629302911343.png

 

 

1 ACCEPTED SOLUTION
ImkeF
Community Champion
Community Champion

Hi @Anonymous ,
you cannot use that syntax to define a record field with a variable name.
Instead, simply leave that field out when defining the record and add that variable named field using the Record.AddField-function.

There, in the 2nd parameter you can reference another paramter or query step.

 

Imke Feldmann (The BIccountant)

If you liked my solution, please give it a thumbs up. And if I did answer your question, please mark this post as a solution. Thanks!

How to integrate M-code into your solution -- How to get your questions answered quickly -- How to provide sample data -- Check out more PBI- learning resources here -- Performance Tipps for M-queries

View solution in original post

1 REPLY 1
ImkeF
Community Champion
Community Champion

Hi @Anonymous ,
you cannot use that syntax to define a record field with a variable name.
Instead, simply leave that field out when defining the record and add that variable named field using the Record.AddField-function.

There, in the 2nd parameter you can reference another paramter or query step.

 

Imke Feldmann (The BIccountant)

If you liked my solution, please give it a thumbs up. And if I did answer your question, please mark this post as a solution. Thanks!

How to integrate M-code into your solution -- How to get your questions answered quickly -- How to provide sample data -- Check out more PBI- learning resources here -- Performance Tipps for M-queries

Helpful resources

Announcements
FabCon and SQLCon Barcelona 2026

FabCon & SQLCon – Barcelona 2026

Join us in Barcelona for FabCon and SQLCon, the Fabric, Power BI, SQL, and AI community event. Save €200 with code FABCMTY200.

60 days of Data Days Carousel

Data Days 2026

Join Data Days 2026: 60 days of free live/on-demand sessions, challenges, study groups, and certification opportunities.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.

Top Solution Authors