cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Anonymous
Not applicable

Refresh not working

On refresh with the below command for getting error "Only managed connections can be refreshed." Please suggest

 

Office365_1.GetEmails({folderPath:"Inbox"})

1 ACCEPTED SOLUTION

Accepted Solutions
CarlosFigueira
Power Apps
Power Apps

Refresh can only be used with connections themselves (and those that represent data sources, such as a SQL table, an Excel file on dropbox, a SharePoint list, and so on), not with a function that is returned by a connection.

 

For your scenario, if you have, for example, a gallery whose Items property is bound to Office365_1.GetEmails({folderPath:"Inbox"}), then you can instead store the items (e-mails) in a collection, and bind the Items property of the gallery to that collection. On a button to refresh the items, you can retrieve the items to the collection again, and since the collection is bound to the Items property of the gallery, the (updated) e-mails will be displayed. You'd also need to initialize the collection once (possibly when reaching the screen where the e-mails are displayed). For this scenario, your formulas would look something like this:

RefreshButton.OnSelect: ClearCollect(emails, Office365_1.GetEmails({folderPath:"Inbox"}))
EmailGallery.Items: emails
BrowseScreen.OnVisible: Select(RefreshButton)

View solution in original post

2 REPLIES 2
CarlosFigueira
Power Apps
Power Apps

Refresh can only be used with connections themselves (and those that represent data sources, such as a SQL table, an Excel file on dropbox, a SharePoint list, and so on), not with a function that is returned by a connection.

 

For your scenario, if you have, for example, a gallery whose Items property is bound to Office365_1.GetEmails({folderPath:"Inbox"}), then you can instead store the items (e-mails) in a collection, and bind the Items property of the gallery to that collection. On a button to refresh the items, you can retrieve the items to the collection again, and since the collection is bound to the Items property of the gallery, the (updated) e-mails will be displayed. You'd also need to initialize the collection once (possibly when reaching the screen where the e-mails are displayed). For this scenario, your formulas would look something like this:

RefreshButton.OnSelect: ClearCollect(emails, Office365_1.GetEmails({folderPath:"Inbox"}))
EmailGallery.Items: emails
BrowseScreen.OnVisible: Select(RefreshButton)

View solution in original post

Staalbaard
Regular Visitor

I also have a list connecting to a Table in an Excel file on OneDrive.

In my case, I had to delete and recreate the connection (with the same name) before it refreshed.

Helpful resources

Announcements
PA User Group

Welcome to the User Group Public Preview

Check out new user group experience and if you are a leader please create your group

secondImage

Demo Extravaganza is Back!

We are excited to announce that Demo Extravaganza for 2021 has started!

MBAS on Demand

Microsoft Business Applications Summit sessions

On-demand access to all the great content presented by the product teams and community members! #MSBizAppsSummit #CommunityRocks

Power Apps June 2021

June Power Apps Community Call

Did you miss the call? Check out the recording here!

Top Solution Authors
Top Kudoed Authors
Users online (39,340)