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
mkredpoint
Frequent Visitor

Nav Table with parameter-driven functions - any way to allow users to enter parameter at preview?

Hi - I'm working on building a custom connector with the SDK.

For nav tables that contain functions - is there a way to allow users to enter values for required parameters at the first data  preview dialog? I get a 'Parameter value not specified' message, but no place where I can enter a parameter in this dialog. Thanks!

 

mkredpoint_0-1675808070157.png

 

 

1 ACCEPTED SOLUTION
mkredpoint
Frequent Visitor

I found a solution in this very excellent reference SDK project:

https://github.com/migueesc123/PowerBIRESTAPI

 

focusing in on the 'functions' nav table has exactly what I was looking for:

 

mkredpoint_0-1676040834021.png

 

 

Hoping this saves sometime time in the future... I spent days trying to figure this out and finally this saved me.

View solution in original post

2 REPLIES 2
mkredpoint
Frequent Visitor

I found a solution in this very excellent reference SDK project:

https://github.com/migueesc123/PowerBIRESTAPI

 

focusing in on the 'functions' nav table has exactly what I was looking for:

 

mkredpoint_0-1676040834021.png

 

 

Hoping this saves sometime time in the future... I spent days trying to figure this out and finally this saved me.

jaweher899
Super User
Super User

To allow users to enter values for required parameters in a custom connector using the Power BI SDK, you can use the setDefaultValue method on the DataParameter object in your DataSource.ts file. This allows you to set a default value for the parameter that the user can then change in the first data preview dialog.

Here's an example:

const myParameter: DataParameter = {
name: "My Parameter",
dataType: DataType.String,
};

myParameter.setDefaultValue("Default Value");

this.dataSource.dataParameters.push(myParameter);

 

In this example, the parameter myParameter is created with a name of "My Parameter" and a data type of DataType.String. The setDefaultValue method is then used to set the default value of the parameter to "Default Value". Finally, the parameter is pushed onto the dataSource.dataParameters array.

This will display a prompt for the user to enter a value for the parameter when they click "Load Data" in the first data preview dialog.

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.