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
Cherie
New Member

Automatically connect to API Requiring Dates in Parts

I'm connecting to an External API and the API URL requires the parts {date_start} and {date_end}.

GET /ranks/{site_id}/{date_start}/{date_end}

 

I can connect to the API easily but, I don't know how I could automatically connect to the API daily and automatically change the date parts to reflect this to then push the data to the data set.

 

I've done this historically through a script but I've new to PowerBI.
When reading the automation document all I find is scheduling the REST API for Power BI.

 

Should I be using the Python Script Connector to call to the API to auto add new data on a schedule?

2 REPLIES 2
v-henryk-mstf
Community Support
Community Support

Hi @Cherie ,

 

In the api you provide, you can only manually enter the date range, but you cannot create a date column to dynamically get the latest date.

 

As for the Python Script Connector, I read the related documents, and it didn’t mention that you can set the dynamic date parameter to get the latest data set.

vhenrykmstf_1-1624589215031.png

 

If you want to dynamically get the latest date and refresh the data set, my suggestion is to configure a scheduled refresh, you can set the refresh interval.

vhenrykmstf_0-1624588821119.png

 

related blog link:

Automate Your Power BI Dataset Refresh with Python - Pivotal BI

Data refresh in Power BI - Power BI | Microsoft Docs

Best Regards,
Henry

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

Thanks for the advice @v-henryk-mstf,
I'll try it an dlet you know if it works.

PREVIEW
 
 
 

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.