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
tahechadv_2022
Helper II
Helper II

Convert M Language to Python

Hi guys!

 

The code below is from Bitrix24 it connects automatically to our database and download the tables directly in PBI, but PBI service can not automatically update the dashboard.

 

I would like to convert it to Python (or any other programming language) in order to upload the tables in our DW. Then it would be easier to connect PBI desktop to our DW and automatically update the dashboards

 

response = Web.Contents(
"https://" & #"Server address",
[
RelativePath = "bitrix/tools/biconnector/pbi.php",
Query = [
//token = #"Secret key",
table = bx24_entity_name
],
Content = Json.FromValue([dateRange = [
startDate = Date.AddYears(Date.From(DateTime.LocalNow()),-1),
endDate = Date.From(DateTime.LocalNow())],
key = #"Secret key"
]
)
]
),
jd = Json.Document(response)

2 ACCEPTED SOLUTIONS

I think didn't explain it clearly.

 

I do not want to write any script inside PBI.

 

I want to write this code in python, to execute it in our server in order to download the tables to our DW instead of downloading it to PBI.

View solution in original post

https://BITRIX-SERVER/bitrix/tools/biconnector/pbi.php?token=SECRET-KEY&table=TABLE_NAME

 

just relace bitrix-server, secret-key and table name, using a GET method and you'll be able to download the tables.

View solution in original post

3 REPLIES 3
v-shex-msft
Community Support
Community Support

HI @tahechadv_2022,

AFAIK, current it only supports R and python scripts as the data source and they will also require a personal data gateway to handle and execute these scripts.

For the sample M query, I'd like to suggest you add the get token steps before the current steps, then these codes can be refreshed without manually updating tokens.

Regards,

Xiaoxin Sheng

Community Support Team _ Xiaoxin
If this post helps, please consider accept as solution to help other members find it more quickly.

I think didn't explain it clearly.

 

I do not want to write any script inside PBI.

 

I want to write this code in python, to execute it in our server in order to download the tables to our DW instead of downloading it to PBI.

https://BITRIX-SERVER/bitrix/tools/biconnector/pbi.php?token=SECRET-KEY&table=TABLE_NAME

 

just relace bitrix-server, secret-key and table name, using a GET method and you'll be able to download the tables.

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.