cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
apayze
New Member

Looking to Refresh an Excel workbook in a SharePoint Online DocLib

Hi,

 

I have a wish to refresh the Excel Data connection, without having to have the user open the Excel File everytime.  I have created a SharePoint page to display the content, but Excel does not refresh the data unless the file is open.  I was wondering if a Flow could be built to refresh the Excel workbook data connection

 

Regards

Andrew Payze

35 REPLIES 35
v-monli-msft
Community Support
Community Support

Hi Andrew,

 

May I know how do you want to update the data in the excel file? In flow, if you want to update a file stored on SharePoint online library, you need to use the action "SharePoint - Update File".

Capture.PNG

 

Regards,

Mona

Community Support Team _ Mona Li
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

I actually have this same question. I have Power Queries that refresh the file when it is opened. I'd like to open the file, let the file run through the refresh of those queries, save it and close it.  Is that possible?

Dodge
Advocate I
Advocate I

Hello?  Anybody in Microsoft Flow reading these things?  An answer of some sort would be helpful here and not having to wait months or years to get a negative or positive response from the team would be really appreciated.  C'mon guys!

Anonymous
Not applicable

Hi there

 

I am trying to do this as wel, but want it to update an excel doc on the same sharepoint.

 

I have set up the flow and it runs, but when I go to open the excel document it says the file is corrupted?

 

Any ideas why this may be?

 

Thanks

You can do this but doing 'Get file content' and then 'Update file' with either SharePoint or OneDrive and it will open and refresh the file.

@rebeccas : could you please elaborate on how you use these two actions?

I tried the following, but it does not refresh my query unfortunately, only modifies the time stamp of the file.

RefreshExcel.png

@J_K_ 

 

I have two similar but different Flows I run for this..I'm not sure your exact need.

 

One is an excel spread sheet that is pulling data from sql. It is looking for only items that have been added to a sql table in the last day and list them here. it has selected in the Excel connection settings both "Refresh data when opening the file" and "Refresh this connection on Refresh All". For the flow I have 'Get file content' and then 'List rows present in a table'...and then it does a condition and  'Create an item'...because it is adding new items that are not already on my SPList.

 

The other is an excel spread sheet that has a few tied fields (LookUps) so it has the same connection settings in excel but the flow is different.  The flow just has my trigger and 'Get file content' and then 'Update file'. We have a few things that pull information from this spread sheet (PowerApp & PowerBi) and so we need it to refresh at least once a day. This one I don't need my Flow to pull out any data, just refresh the data and that is what it does.

 

Hope this helps.

Hi @rebeccas 

thank you for your reply.

I think what I am trying to do is your second example. I have a data query in the Excel file to a txt file which is an extract from a database that gets updated daily.

The Excel table that gets created from the query is pulled from a flow that populates a SharePoint list which we use as data source in PowerApps. (Using the Excel table directly in PowerApps crashed the refresh of the data query)

Could you maybe provide a screenshot of your second example? I need the flow to refresh the data query but can't get it to work.

@J_K_ 

 

Yeah, it is pretty simple one. I have a few things tied to this excel sheet so I have it set to refresh each morning. I went ahead and ran it to show you it updates the last modified after the Flow runs. It also updates the data on everything that is pulling from this. 

 

Here is the before and after of the modified (I ran it a few minutes apart) showing you it is "modifying" it which is really just refreshing the data. 

 

After.JPGBefore.JPG

 

And then here is the Flow:

 

FlowDetails.JPGFlowRan.JPG

 

Let me know if you have any other questions on this that I can possibly help with.

 

 

Thanks for that info Rebeccas.  That's the kind of response I would hope to see from Microsoft regarding the usage of one of their threshold products.  Glad someone was able to respond properly after 2 and 1/2 years.

Hi @rebeccas sorry to bother you again.

As I see it, I have created exactly the same flow.

Get file content,

update file for the same file using the dynamic content "file content" from the previous step.

 

Also, as you pointed out in your initial response, I have adjusted the Excel connection settings accordingly:

ExcelConnectionSettings.png

 

Do you have any further ideas what could make the difference?

@J_K_ 

 

Not off hand. Is it just not updating it or are you getting an actuall error for your Flow?

@rebeccas The flow completes successfully and the time stamp of the Excel file is indeed modified. But when I pull the data from the Excel table that gets created from the data query, it doesn't show the new entries.

@J_K_ 

 

What do you have that is looking at that data? I am thinking that may be the issue.

 

I have three different things that look at my excel sheet. A PowerApp (which is refreshing the data), a PowerBi (which is refreshing the data) and another Excel spread sheet with LookUps that is looking at this one (which basically looks up the values when you open it so it is refreshing the data in a sense). 

@rebeccas I'm looking at the data with another Excel file. But I created this merely to check if the refresh has been completed successfully. I don't know how this could prevent the refresh from happening.

the actual data flow is like this:

1. txt file (extract from database is provisioned daily)

2. Excel file with data query to the txt file resulting in an Excel table

3. A flow to refresh the data query and then pull the data and update/create items in a SharePoint list.

 

I don't really understand how PowerApps and Power BI refresh the Excel. I found that the refresh in the Excel file was actually prevented when the Excel file is used by PowerApps as data source.

@J_K_ 

 

You can't Refresh() in the app for excel..I mean it Refreshes when you open the app. 

 

Mine the data is only refreshed once a day by my Flow and that particular information will not change throughout the day. I am referring to it as a look up field in my App.

 

If you are doing any of this with a PowerApp and you want current accurate data that changes often I would suggest a SharePoint list Excel is not good for that. Excel and PowerApps are not friends!

 

Mine works fine for what I need but I do consider it to be a temporary fix and will move that data into a sharepoint list as soon as I can finish getting everyone on-board.

 

Only other thing I can think of is maybe other settings in Excel that I didn't think of that were already set on mine. For example...if it were one where you have click "enable content" everytime then the flow most likely won't account for that. You can change some Excel settings to avoid that...I think in the Trust Center.

 

I'm out of practice on Excel these days...I very rarely use it anymore. 

@rebeccas Okay, thanks for your answer. So do I understand you correctly? You always open the Excel file manually once a day?

This is what I wanted to avoid and let Flow do instead.

 

I also try to avoid Excel but in this case, since we don't have direct access to the database but only the txt file extract, I am using Excel as a workaround to get the data into SharePoint. I am NOT using Excel with PowerApps directly.

Try unchecking the enable background refresh.

Helpful resources

Announcements

Community will be READ ONLY July 16th, 5p PDT -July 22nd

Dear Community Members,   We'd like to let you know of an upcoming change to the community platform: starting July 16th, the platform will transition to a READ ONLY mode until July 22nd.   During this period, members will not be able to Kudo, Comment, or Reply to any posts.   On July 22nd, please be on the lookout for a message sent to the email address registered on your community profile. This email is crucial as it will contain your unique code and link to register for the new platform encompassing all of the communities.   What to Expect in the New Community: A more unified experience where all products, including Power Apps, Power Automate, Copilot Studio, and Power Pages, will be accessible from one community.Community Blogs that you can syndicate and link to for automatic updates. We appreciate your understanding and cooperation during this transition. Stay tuned for the exciting new features and a seamless community experience ahead!

Summer of Solutions | Week 4 Results | Winners will be posted on July 24th

We are excited to announce the Summer of Solutions Challenge!    This challenge is kicking off on Monday, June 17th and will run for (4) weeks.  The challenge is open to all Power Platform (Power Apps, Power Automate, Copilot Studio & Power Pages) community members. We invite you to participate in a quest to provide solutions to as many questions as you can. Answers can be provided in all the communities.    Entry Period: This Challenge will consist of four weekly Entry Periods as follows (each an “Entry Period”)   - 12:00 a.m. PT on June 17, 2024 – 11:59 p.m. PT on June 23, 2024 - 12:00 a.m. PT on June 24, 2024 – 11:59 p.m. PT on June 30, 2024 - 12:00 a.m. PT on July 1, 2024 – 11:59 p.m. PT on July 7, 2024 - 12:00 a.m. PT on July 8, 2024 – 11:59 p.m. PT on July 14, 2024   Entries will be eligible for the Entry Period in which they are received and will not carryover to subsequent weekly entry periods.  You must enter into each weekly Entry Period separately.   How to Enter: We invite you to participate in a quest to provide "Accepted Solutions" to as many questions as you can. Answers can be provided in all the communities. Users must provide a solution which can be an “Accepted Solution” in the Forums in all of the communities and there are no limits to the number of “Accepted Solutions” that a member can provide for entries in this challenge, but each entry must be substantially unique and different.    Winner Selection and Prizes: At the end of each week, we will list the top ten (10) Community users which will consist of: 5 Community Members & 5 Super Users and they will advance to the final drawing. We will post each week in the News & Announcements the top 10 Solution providers.  At the end of the challenge, we will add all of the top 10 weekly names and enter them into a random drawing.  Then we will randomly select ten (10) winners (5 Community Members & 5 Super Users) from among all eligible entrants received across all weekly Entry Periods to receive the prize listed below. If a winner declines, we will draw again at random for the next winner.  A user will only be able to win once overall. If they are drawn multiple times, another user will be drawn at random.  Individuals will be contacted before the announcement with the opportunity to claim or deny the prize.  Once all of the winners have been notified, we will post in the News & Announcements of each community with the list of winners.   Each winner will receive one (1) Pass to the Power Platform Conference in Las Vegas, Sep. 18-20, 2024 ($1800 value). NOTE: Prize is for conference attendance only and any other costs such as airfare, lodging, transportation, and food are the sole responsibility of the winner. Tickets are not transferable to any other party or to next year’s event.   ** PLEASE SEE THE ATTACHED RULES for this CHALLENGE**   Week 1 Results: Congratulations to the Week 1 qualifiers, you are being entered in the random drawing that will take place at the end of the challenge.   Community MembersNumber SolutionsSuper UsersNumber Solutions Deenuji 9 @NathanAlvares24  17 @Anil_g  7 @ManishSolanki  13 @eetuRobo  5 @David_MA  10 @VishnuReddy1997  5 @SpongYe  9JhonatanOB19932 (tie) @Nived_Nambiar  8 @maltie  2 (tie)   @PA-Noob  2 (tie)   @LukeMcG  2 (tie)   @tgut03  2 (tie)       Week 2 Results: Congratulations to the Week 2 qualifiers, you are being entered in the random drawing that will take place at the end of the challenge. Week 2: Community MembersSolutionsSuper UsersSolutionsPower Automate  @Deenuji  12@ManishSolanki 19 @Anil_g  10 @NathanAlvares24  17 @VishnuReddy1997  6 @Expiscornovus  10 @Tjan  5 @Nived_Nambiar  10 @eetuRobo  3 @SudeepGhatakNZ 8     Week 3 Results: Congratulations to the Week 3 qualifiers, you are being entered in the random drawing that will take place at the end of the challenge. Week 3:Community MembersSolutionsSuper UsersSolutionsPower Automate Deenuji32ManishSolanki55VishnuReddy199724NathanAlvares2444Anil_g22SudeepGhatakNZ40eetuRobo18Nived_Nambiar28Tjan8David_MA22   Week 4 Results: Congratulations to the Week 4 qualifiers, you are being entered in the random drawing that will take place at the end of the challenge. Week 4:Community MembersSolutionsSuper UsersSolutionsPower Automate Deenuji11FLMike31Sayan11ManishSolanki16VishnuReddy199710creativeopinion14Akshansh-Sharma3SudeepGhatakNZ7claudiovc2CFernandes5 misc2Nived_Nambiar5 Usernametwice232rzaneti5 eetuRobo2   Anil_g2   SharonS2  

Check Out | 2024 Release Wave 2 Plans for Microsoft Dynamics 365 and Microsoft Power Platform

On July 16, 2024, we published the 2024 release wave 2 plans for Microsoft Dynamics 365 and Microsoft Power Platform. These plans are a compilation of the new capabilities planned to be released between October 2024 to March 2025. This release introduces a wealth of new features designed to enhance customer understanding and improve overall user experience, showcasing our dedication to driving digital transformation for our customers and partners.    The upcoming wave is centered around utilizing advanced AI and Microsoft Copilot technologies to enhance user productivity and streamline operations across diverse business applications. These enhancements include intelligent automation, AI-powered insights, and immersive user experiences that are designed to break down barriers between data, insights, and individuals. Watch a summary of the release highlights.    Discover the latest features that empower organizations to operate more efficiently and adaptively. From AI-driven sales insights and customer service enhancements to predictive analytics in supply chain management and autonomous financial processes, the new capabilities enable businesses to proactively address challenges and capitalize on opportunities.    

Updates to Transitions in the Power Platform Communities

We're embarking on a journey to enhance your experience by transitioning to a new community platform. Our team has been diligently working to create a fresh community site, leveraging the very Dynamics 365 and Power Platform tools our community advocates for.  We started this journey with transitioning Copilot Studio forums and blogs in June. The move marks the beginning of a new chapter, and we're eager for you to be a part of it. The rest of the Power Platform product sites will be moving over this summer.   Stay tuned for more updates as we get closer to the launch. We can't wait to welcome you to our new community space, designed with you in mind. Let's connect, learn, and grow together.   Here's to new beginnings and endless possibilities!   If you have any questions, observations or concerns throughout this process please go to https://aka.ms/PPCommSupport.   To stay up to date on the latest details of this migration and other important Community updates subscribe to our News and Announcements forums: Copilot Studio, Power Apps, Power Automate, Power Pages