cancel
Showing results for 
Search instead for 
Did you mean: 
Reply

Showing newly updated field in Sharepoint list inside PowerApp

Hi,

 

I have a PowerApp where the underlying data is in a SharePoint List.


I have a button in my PowerApp - which runs a Power Automate flow.

 

The last part of the flow does an 'Update Item' using the Sharepoint connector.

 

This works and 10 seconds later a blank field is populated with the required data on an already existing row.

 

I have a Label in my flow which is connected to that field.

 

Seems easy...but I cannot see how to display that newly created value into that field....

 

My PowerApp has 2 screens (my label is on screen 2) and if I navigate back to Screen 1 and then back to Screen 2 - the label with the data correctly shows.

 

But I don't want the user to have to do that.

 

Either I would like to have a Timer (where onTimerEnd ... say after 20 seconds .. when the data will definitely be there from the PowerAutomate it refreshes)...or I can have a 'reload' icon which the user can manually click. 

 

I just want that new data to show in a field without having the user navigate back to screen 1 and then to screen 2.

 

The field is inside a Gallery which is connected to a Sharepoint List as mentioned...however, weirdly if I select the Gallery (Gallery 2) and on the Properties on the right of the screen - it shows:

 

Data Source: Custom.

(Is this because I have a Gallery on screen 1 pointing to the same SP list?)

 

I have tried: Refresh (Name of SP List) - but this doesn't update the record either.

 

Also using Monitor - it looks like it is only refreshing Gallery 1 .. which is on screen 1 and also points to the same Sharepoint List).

 

How do I refresh this 'Custom' datasource...so Gallery 2 is updated.

 

Or - is there a better way to achieve this? I am seeing posts about using UpdateContext...but I am not sure I am using it correctly.

 

The fact that I can navigate out of the screen and back must mean I can do something staying on the same screen and refreshing that label? 

 

Thanks for any advice.

 

1 ACCEPTED SOLUTION

Accepted Solutions

@Nav12 

Yes, the reason you see what you see is because you are using a snapshot variable.  It never updates until you update it in your app.  Thus the, go back to screen 1 and then back to the record.

 

So, looking at the Items property, this is a simple formula (meaning that some other complexities will not arise), so you really don't need the variable at all.

 

Now, I'm a little confused why you would have a Gallery that only ever shows one record.  Your Gallery1 is the record.  Gallery2 does what??

 

Change the Items property of Gallery2 to : Table(Gallery1.Selected)

Change the OnSelect property of  Gallery1 to : Navigate(Detailed, Fade)

 

I specifically mention the OnSelect formula above to eliminate the selectedItem variable.  We will know immediately (by any other errors that pop up) if you are relying on that some place else...which we should then change.

 

_____________________________________________________________________________________
Digging it? - Click on the Thumbs Up below. Solved your problem? - Click on Accept as Solution below. Others seeking the same answers will be happy you did.
NOTE: My normal response times will be Mon to Fri from 1 PM to 10 PM UTC (and lots of other times too!)
Check out my PowerApps Videos too! And, follow me on Twitter @RandyHayes

Really want to show your appreciation? Buy Me A Cup Of Coffee!

View solution in original post

18 REPLIES 18

@Nav12 

The trick would be to make sure your flow completes.  You can achieve this by setting the result of the flow to a context variable:

   UpdateContext({flowResults: yourFlow.Run(params)})

This will cause the app to wait for the flow to complete.

Then, after that, perform a Refresh on the datasource that is impacted by the flow.

 

As long as you have no other snapshot variables or collections at play, your label will update properly.

If not, then what is the Text property of the label?

 

I hope this is helpful for you.

_____________________________________________________________________________________
Digging it? - Click on the Thumbs Up below. Solved your problem? - Click on Accept as Solution below. Others seeking the same answers will be happy you did.
NOTE: My normal response times will be Mon to Fri from 1 PM to 10 PM UTC (and lots of other times too!)
Check out my PowerApps Videos too! And, follow me on Twitter @RandyHayes

Really want to show your appreciation? Buy Me A Cup Of Coffee!

Thanks Randy. The flow definitely completes as I can see the data in the SP list. I’ve tried refresh - but I’m not sure it is updating the data source based on what monitor is showing. How do I refresh a Data source that shows as custom? I’m not going to be in front of my PC for another day; but I’ll let you know what is behind that field then. Thanks for replying.

@Nav12 

Not entirely sure what you mean by "a Data source that shows as custom".  Can you explain that a little?

 

The key point in the response was to set a throw away variable to the result of the flow.  This will ensure that the flow is complete.  After that, a refresh on the Datasource will get a fresh set of values in your session table based on the changes that the flow made.

Take your time and just respond back when you get some PC time.

_____________________________________________________________________________________
Digging it? - Click on the Thumbs Up below. Solved your problem? - Click on Accept as Solution below. Others seeking the same answers will be happy you did.
NOTE: My normal response times will be Mon to Fri from 1 PM to 10 PM UTC (and lots of other times too!)
Check out my PowerApps Videos too! And, follow me on Twitter @RandyHayes

Really want to show your appreciation? Buy Me A Cup Of Coffee!

Hi Randy,

 

The Gallery shows its Datasource as 'Custom' :

 

Nav12_0-1619089557214.png

 

Therefore - when I issue the Refresh (data_source) ... I am not sure what to put into data_source?

 

The items within Gallery2 are from a Sharepoint List and that datasource is added into the PowerApp.

 

On screen 1 - I have a Gallery1 which points to the same data_source and that one in the similar screenshot above correctly shows the data_source name.

 

So - when I do issue the Refresh (data_source) command - it only refreshes that screen....but nothing in screen 2 and I am presuming this is because it shows as Custom?

 

Though - like I say - I can navigate back to screen 1 and then forward to screen 2 and the field then populates correctly...

@Nav12 

Then the question is, what is the Items property of Gallery2?  That will reveal the datasource.

 

_____________________________________________________________________________________
Digging it? - Click on the Thumbs Up below. Solved your problem? - Click on Accept as Solution below. Others seeking the same answers will be happy you did.
NOTE: My normal response times will be Mon to Fri from 1 PM to 10 PM UTC (and lots of other times too!)
Check out my PowerApps Videos too! And, follow me on Twitter @RandyHayes

Really want to show your appreciation? Buy Me A Cup Of Coffee!

Hi @RandyHayes 

 

The Items property shows as this:

 

selectedItem

 

Therefore I tried:

 

Refresh(selectedItem)

 

Nothing happened unfortunately - it did not refresh the field.

 

There is a red squiggle line under the Refresh command which says:

 

"Only managed connections can be refreshed"

 

Thanks!

@Nav12 

What is selectedItem?  That is certainly not a datasource.  Looks like some kind of Variable.  Which is where your problem is going to be.  If you Gallery is based on a variable, then it will never change until the variable is changed.  There should be no variable used.

Where is selectedItem defined?

_____________________________________________________________________________________
Digging it? - Click on the Thumbs Up below. Solved your problem? - Click on Accept as Solution below. Others seeking the same answers will be happy you did.
NOTE: My normal response times will be Mon to Fri from 1 PM to 10 PM UTC (and lots of other times too!)
Check out my PowerApps Videos too! And, follow me on Twitter @RandyHayes

Really want to show your appreciation? Buy Me A Cup Of Coffee!

Thanks @RandyHayes   - I also have no idea :).

 

I must have it somewhere....let me try and find it.....I don't suppose there is some kind of 'Find' is there?

 

I think the mistake was that I used a template app - but I had pretty much wiped out all the components and started again. Perhaps I left some remnants in there. 

Though these are brand new Galleries - which I thought were pointing to my new SharePoint lists.

 

You are certainly pointing me in the right direction and for that I thank you.

@Nav12 

If it is a variable (suspected) then you can go to the variable viewer.  This is from the menu at the top, choose View then Variables

 

Yeah, that is definitely not your list.  So hunt it down and see where you are setting it and why in the world you would need it.

_____________________________________________________________________________________
Digging it? - Click on the Thumbs Up below. Solved your problem? - Click on Accept as Solution below. Others seeking the same answers will be happy you did.
NOTE: My normal response times will be Mon to Fri from 1 PM to 10 PM UTC (and lots of other times too!)
Check out my PowerApps Videos too! And, follow me on Twitter @RandyHayes

Really want to show your appreciation? Buy Me A Cup Of Coffee!

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 in the Forums 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 of SolutionsSuper UsersNumber of Solutions @anandm08  23 @WarrenBelz  31 @DBO_DV  10 @Amik  19 AmínAA 6 @mmbr1606  12 @rzuber  4 @happyume  7 @Giraldoj  3@ANB 6 (tie)   @SpongYe  6 (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. Community MembersSolutionsSuper UsersSolutions @anandm08  10@WarrenBelz 25 @DBO_DV  6@mmbr1606 14 @AmínAA 4 @Amik  12 @royg  3 @ANB  10 @AllanDeCastro  2 @SunilPashikanti  5 @Michaelfp  2 @FLMike  5 @eduardo_izzo  2   Meekou 2   @rzuber  2   @Velegandla  2     @PowerPlatform-P  2   @Micaiah  2     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 Apps anandm0861WarrenBelz86DBO_DV25Amik66Michaelfp13mmbr160647Giraldoj13FLMike31AmínAA13SpongYe27     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 Apps DBO-DV21WarranBelz26Giraldoj7mmbr160618Muzammmil_0695067Amik14samfawzi_acml6FLMike12tzuber6ANB8   SunilPashikanti8

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

Users online (1,263)