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

Power BI is turning 10! Let’s celebrate together with dataviz contests, interactive sessions, and giveaways. Register now.

Reply
f_daniel_souza
New Member

Implement TestConnection with both Uri.Type plus optional parameter

Hello, I'm trying to create a custom connector for our company Microsoft Purview. We basically use two urls, one to query, which has mandatory json parameter, and another which will receive an entity id directly on url's relative path (executing once per table row). In Power BI Desktop, this connector works wonderfully, however I'm struggling to implement TestConnection. I would like to keep the Uri.Type parameter because of the relative url invocations, however it seems like datasourcepath has a really weird behaviour when trying to set up TestConnection when I need to use both parameters at once.

 

 

2 REPLIES 2
Akash_Varuna
Community Champion
Community Champion

Hi @f_daniel_souza To do the TestConnection with Uri.Type and an optional parameter, ensure the DatasourcePath combines the base URL and parameters logically. Structure TestConnection to match the arguments of your DatasourcePath. Use Record.ToTable to include optional parameters effectively. Test thoroughly with both URL types to ensure compatibility.

Hi @Akash_Varuna, thank you so much for the reply. Do you have any code example representing this scenario? I have already tried several different things, such as parsing the dataSourcePath with Json.Document, or using static values, some of them actually pass the VSCode TestConnection but fail on Power BI Service. I think I've read all Github examples, but none of them covers a Uri.Type + second parameter, so I assumed Microsoft "special handling" of Uri.Type might be causing the problem.

Helpful resources

Announcements
June 2025 Power BI Update Carousel

Power BI Monthly Update - June 2025

Check out the June 2025 Power BI update to learn about new features.

June 2025 community update carousel

Fabric Community Update - June 2025

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

Top Solution Authors