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
Payeras_BI
Solution Sage
Solution Sage

Help with "Dynamics365BusinessCentral.ApiContentsWithOptions"

Hello,

Does anyone know if it is possible to specify the Business Central tenant in the following PQ function?


Dynamics365BusinessCentral.ApiContentsWithOptions(
optional environment as text,
optional company as text,
optional apiRoute as text,
optional options as record
) as table

Let's say the user I authenticate with has access to different tenants and I need to specify it to access one or the other.

Cheers,

 

If this post answered your question, please mark it as a solution to help other users find useful content.
Kudos are another nice way to acknowledge those who tried to help you.

J. Payeras
Mallorca, Spain
1 ACCEPTED SOLUTION
Anonymous
Not applicable

Hi @Payeras_BI ,

After a documentation search and testing, the Dynamics365BusinessCentral.ApiContentsWithOptions function does not currently directly support specifying tenants as part of its parameters. The tenant context is typically determined by the authentication token used in the connection, which is associated with the user's credentials and the tenants they can access.
Maybe if you have control over the Business Central environment, you could potentially create a custom API that allows specifying the tenant as part of the API call. This custom API would then handle the tenant-specific logic on the Business Central side.

Best Regards,
Dino Tao
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

3 REPLIES 3
Payeras_BI
Solution Sage
Solution Sage

Hello,
too bad you can't, but thanks for checking it out.

Regards,

 

If this post answered your question, please mark it as a solution to help other users find useful content.
Kudos are another nice way to acknowledge those who tried to help you.

J. Payeras
Mallorca, Spain
Anonymous
Not applicable

Hi @Payeras_BI ,

After a documentation search and testing, the Dynamics365BusinessCentral.ApiContentsWithOptions function does not currently directly support specifying tenants as part of its parameters. The tenant context is typically determined by the authentication token used in the connection, which is associated with the user's credentials and the tenants they can access.
Maybe if you have control over the Business Central environment, you could potentially create a custom API that allows specifying the tenant as part of the API call. This custom API would then handle the tenant-specific logic on the Business Central side.

Best Regards,
Dino Tao
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Hi again @Anonymous ,

Could you tell me where to find all the possible "options" available for this function?

"optional options as record"

Thanks in advance.

 

If this post answered your question, please mark it as a solution to help other users find useful content.
Kudos are another nice way to acknowledge those who tried to help you.

J. Payeras
Mallorca, Spain

Helpful resources

Announcements
Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.

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.