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

Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and more. Get started

Reply
mvcsharepointde
Helper II
Helper II

Automatic Refresh for a model which get data from external API

I have  this Models to get data from external API:-

 

mvcsharepointde_0-1723407776353.png

 

 

and this advance query:-

 

let
    body=Text.Combine({"sAPIKey=",ApiKey}),
	SourceAPILogin=Json.Document(
						Web.Contents(
								SmartAPI, 
								[
									RelativePath="apilogin",
									Headers=[Accept="application/json", #"Content-Type"="application/x-www-form-urlencoded",#"API-Key"=Token],
									Content=Text.ToBinary(body)
								]
								)
						),
    tblGetUID = Table.FromList(SourceAPILogin, Splitter.SplitByNothing(), null, null, ExtraValues.Error),
    expGetUID = Table.ExpandRecordColumn(tblGetUID, "Column1", {"UID", "LanguageCode", "DatabaseVersion"}, {"Column1.UID", "Column1.LanguageCode", "Column1.DatabaseVersion"}),
    GetUID = expGetUID{0}[Column1.UID],
    Source=Json.Document(
						Web.Contents(
								SmartAPI,
								[
									RelativePath = "gettimeledgerentry", //RESTAPI endpoint
									//Query = [#"Filter" ="WorkTypeCode LIKE 'Normal'"], // QueryParameters
								    Headers=[Accept="application/json", #"Content-Type"="application/json",#"API-Key"=Token, UID=GetUID, DeviceID=ApiKey] //Headers
								]
								)
						),
    #"Converted to Table" = Table.FromList(Source, Splitter.SplitByNothing(), null, null, ExtraValues.Error),
    //display all the columns from query
    Result=Table.ExpandRecordColumn( #"Converted to Table","Column1", Table.ColumnNames(Table.FromRecords(List.Select(Table.Column(#"Converted to Table","Column1"), each _ <> "" and _ <> null))),Table.ColumnNames(Table.FromRecords(List.Select(Table.Column(#"Converted to Table","Column1"), each _ <> "" and _ <> null)))),
    #"Changed Type" = Table.TransformColumnTypes(Result,{{"StartTime", type datetime}, {"EndTime", type datetime}, {"LogStart", type datetime}, {"LogEnd", type datetime}})
in
    #"Changed Type"

 

 

Then i am showing the data inside 2 pages, as follow:-

 

mvcsharepointde_3-1723407926994.png

 

 

mvcsharepointde_2-1723407879005.png

 

 

now seems the data inside the reports will not get updated unless i do a manual refresh to the data source. so how i can enable an automatic refresh to the report data? or when a user visit the reprot to get the data updated data from the API?

 

mvcsharepointde_4-1723408021047.png

 

 

Thanks

 

 

 

 

1 ACCEPTED SOLUTION

Hi @mvcsharepointde,
Yes, your report will refresh 8 times per day according to the chosen times.

View solution in original post

7 REPLIES 7
mvcsharepointde
Helper II
Helper II

@ahadkarimi Thanks for the reply. How i can access this schdule page? i can not find it, here what i have inside the online power bi home page:-

 

mvcsharepointde_0-1723415509121.png

 

and inside the power bi desktop:-

 

mvcsharepointde_0-1723415762459.png

 

 

@mvcsharepointde If you're using Power BI Report Server, after publishing your report, there is a setting...

ahadkarimi_0-1723416443561.png

 

@ahadkarimi Thanks again for the reply. I published the reprot to My workspace not to power bi server.. and i share it using onedrive.. sorry i am a bit new to power BI.. so not sure if i can set a schdule for my reprot.

@mvcsharepointde Even in My Workspace, you can set up a schedule for your report:

ahadkarimi_1-1723420739854.png

 

 

@ahadkarimi Thanks for the reply. Ok i set those schdule inside my workspace:-

mvcsharepointde_0-1723463094955.png

 

 

which means that the report should get updated 8 times per day? am i correct?

 

Hi @mvcsharepointde,
Yes, your report will refresh 8 times per day according to the chosen times.

ahadkarimi
Solution Specialist
Solution Specialist

Set Up Scheduled Refresh in Power BI Service, If you have any questions or need more information, feel free to reach out to me!

ahadkarimi_0-1723413599272.png

 

ahadkarimi_2-1723413634753.png

 

Helpful resources

Announcements
September Hackathon Carousel

Microsoft Fabric & AI Learning Hackathon

Learn from experts, get hands-on experience, and win awesome prizes.