cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Newbie12
Helper V
Helper V

Update/Refresh TemplateFill of Gallery after Submit button is pressed in PowerApps

Hi,

 

I have 2 Screens. DataSource is Excel Table say "Table1" in this case.

 

Screen1: Contains Gallery about Systems Say "Sys1","Sys2" etc. This Gallery has Tile for each system and the TemplateFill property of Systems is set based on "Previous Instrument Status"[Available,In Use, OOS]. The code in TemplateFill property looks like below. Where System Tiles are coded based on Instrument previous Status. Available= Green, In Use= Yellow, OOS= Red. I have two columns  in Excel table for the instrument status "Previous Status" and "Current Status".

 

If(Thisitem."Previous Status"="Available",RGBA(54,176,75,100),If(Thisitem."Previous Status"="Out of Service",RGBA(255,0,0,100),RGBA(255,191,0,100))

 

Screen 2: Contains "Signup" form , where endusers can signup for only instruments that are in "Available" Status (Green Color). I have submit button with below Patch function, and "Current Status" is hard coded to "In Use".

 

If(CountRows(Filter(Table1, System=SystemControl.Text && Model=""))>0,                                                  Patch(Table1,LookUp(Table1, System=SystemControl.Text && Model=""), {Model: DatacardValue10.Text, UserName: UserControl.Text,’Current Status’:”In Use”}),                                                                                                       Patch(Table1,Defaults(Table1),{System:SystemControl.Text, Model: DatacardValue10.Text, UserName: UserControl.Text,’Current Status’:”In Use”}));ResetForm(Form1)

 

I would like to refresh/update my Screen 1 once user  click submit button, because the status of the instrument is changed from "Available"  (Previous Status Showing in Screen 1) to "In Use" (Current Status of instrument after submit button is clicked) .

 

I am not sure how to achieve this in PowerApps.

Any help is appreciated!

Thanks in advance,

1 ACCEPTED SOLUTION

Accepted Solutions
dariobois
Resolver II
Resolver II

Hi @Newbie12 

 

Do you need something like this?

 

2020-10-21-12-06-15.gif

 

Try this on the TemplateFill property of the 1st screen gallery:

 

If(And(Thisitem."Previous Status"="Available",Not(Thisitem."Current Status"="In Use")),RGBA(54,176,75,100),If(Thisitem."Previous Status"="Out of Service",RGBA(255,0,0,100),RGBA(255,191,0,100))

 

Regards!

 

View solution in original post

5 REPLIES 5
RandyHayes
Super User
Super User

@Newbie12 

This will happen automatically in PowerApps depending on the datasource of your Gallery.  

If your Gallery is based on your DataSource and your SignUp form is also based on that datasource, then when you return to the gallery screen the gallery will be updated.

 

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.
Check out my PowerApps Videos too! And, follow me on Twitter @RandyHayes

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

@RandyHayes,

 

Correct, but  tile color in Gallery are based on "Previous Status" of the instrument. I would like to change the Tile color based on "Current Status", which is only true for Instrument that are "Available". 

 

Ex: Let's say the tile color of "Sys1" based on "Previous Status" was Green. When Submit button is clicked, the "Current Status" is in "Use". So the tile color should change to "Yellow" instead of Green.

@Newbie12 

Sure that can be done. 

I have some questions for clarification though.  Are you stating that if the Current Status is "Available" then the color would be based off of "Previous Status"?  And that if the "Current Status" is not "Available" then the color should be based off of the "Current Status"?

 

_____________________________________________________________________________________
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.
Check out my PowerApps Videos too! And, follow me on Twitter @RandyHayes

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

Hi @Newbie12 

 

Do you need something like this?

 

2020-10-21-12-06-15.gif

 

Try this on the TemplateFill property of the 1st screen gallery:

 

If(And(Thisitem."Previous Status"="Available",Not(Thisitem."Current Status"="In Use")),RGBA(54,176,75,100),If(Thisitem."Previous Status"="Out of Service",RGBA(255,0,0,100),RGBA(255,191,0,100))

 

Regards!

 

View solution in original post

@dariobois, That worked fine. Thanks!

Helpful resources

Announcements
PA_User Group Leader_768x460.jpg

Manage your user group events

Check out the News & Announcements to learn more.

Community Connections 768x460.jpg

Community & How To Videos

Check out the new Power Platform Community Connections gallery!

Welcome Super Users.jpg

Super User Season 2

Congratulations, the new Super User Season 2 for 2021 has started!

Carousel 2021 Release Wave 2 Plan 768x460.jpg

2021 Release Wave 2 Plan

Power Platform release plan for the 2021 release wave 2 describes all new features releasing from October 2021 through March 2022.

Top Solution Authors
Top Kudoed Authors
Users online (2,406)