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

Last Refresh time via REST API

 

I would like to find out the last refresh time for a tile. I'm using the Get Tiles REST API but it only gives me the tile id, title and embedUrl.

 

Does anyone know how I can get the refresh time from an API call?  Or even for underlying dashboard or dataset?

 

My application renders tiles to SVG which then get embedded in some PDF's via a custom CMS.  I have to render the tile in a headless brower (using the power bi javascript SDK) and and then render the HTML result as SVG.  That's an an expensive operation, so I want to cache the SVG's until the next data refresh. 

 

I've read how to include the last refresh time in my data tables.  But I don't think there's any API to get the raw data from a table (please correct me if I'm wrong!) And so, I guess I could render a dummy table visualisation with the last refresh time as HTML, then scrape the value from the HTML to decide whether to hang on my cache or re-render the SVG's.  It's do-able but not very elegant.  

 

Has anyone got any ideas?  

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

Hi @simonhobman,

 

You can add a variable to store the start time and use add column to add the end time.

 

For example:

 

let
    StartTime= DateTime.LocalNow(),
    DataTable= ()=> Table.FromValue({"ABC", "Boom", "Test"}),
    Output = Table.AddColumn(Table.AddColumn(DataTable(),"Start Time",each StartTime), "Refresh Time",each DateTime.LocalNow())
in
    Output

 

 

Notice: It only available to show the last operation time, I haven't found a way to store the history date time.

 

Regards,

Xiaoxin Sheng

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

Thanks for the response.  I'm aware I can add the column.  

 

Once I add the column, do you know a way I can access the field via an API?

 

/Simon

 

Hi @simonhobman,

 

>>Once I add the column, do you know a way I can access the field via an API?

This field is a temp fields which added by power query, it not really exist in the result of api, so you can't use api to access it.

 

Regards,

Xiaoxin Sheng

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

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.

Top Solution Authors
Top Kudoed Authors