Hi,
My DataSource is Excel table. Below is snipped of my Initial table. I have 4 screen as mention below
Screen 1: Gallery with different System tiles and system status,which navigates to Screen 2. I use template fill to show current system status (Available=Green,In Use=Yellow,OOS=Red)
Screen 2: Systems Summary is displayed with 3 buttons on Screen. Signup,Update Status,Cancel
Screen 3: Signup Screen (Navigation from Screen 2)
Screen 4: Update Status Screen (Navigation from Screen 2)
The Signup Screen is setup in such a manner that when user clicks submit button, the code will search if there is data for system.If the data is missing for the system, that row for system will be updates. In below snipped, we can see that User1 signup for "Sys1" and it's current status was set to "In Use". Once User1 is done with using Sys1, he will navigate to Update Status screen and will update instrument status to "Available".
The issue occurs when User 2 signup for Sys1. Though the row will be appended for "Sys1" in Excel Table. I am getting an extra tile for Sys1 in Screen 1. Below is the snippet of updated excel table after User 2 signup. Below is the code for Template fill,Gallery.Items property of Screen 1.
Gallery-> Items Property code of Screen 1
GroupBy(Filter(Table1,Startswith('System Name',"Sys"),"System_x0200_Name","ByName"))
Template Fill code of Screen 1
If(And(ThisItem.'Previous Status'="Available",Not(ThisItem.'Current Status'="In Use")),RGBA(54,176,75,100),ThisItem.Previous Status="Out Of Service",RGBA(255,0,0,100),RGBA(255,191,0,100))
Above code is producing Gallery with empty tiles shown below:
Note: If I use Filter code, I can see duplicate tile for same system. However, when I use GroupBy code wrapped around filter code, I am getting above screen in Screen 1
Please provide explanation with code.
Hi @VijayTailor,
Can you please elaborate more on "Now you can Crosscheck on what basis you filtering for your requirement",possibly with code ?
I was thinking of creating an IF statement where my Syntax will be IF(check for duplicate in Table) then filter based on last Instrument Current Status and display only one instrument for the duplicate, else display the instrument.I am not sure how to achieve this in Gallery Items property ?
Is there any another approach I can try to display single tile for duplicate instrument ?
Thanks in advance!
Hi @Newbie12 ,
Below is the Code is Creating New Record.
Now you can Crosscheck on what basis you filtering for your requirement.
Patch(Table1,Defaults(Table1),{'System Name':DataCardValue1.Text,'Model'=DataCardValue2.Text,'Current Status':"In Use"});Navigate(Screen1);ResetForm(Form1)
Another solution is -
you can replace the below if the part with the below Code. (Hope your Issue is resolved)
If(CountRows(Filter(Table1,Lower("System Name")=Lower(DataCardValue1.Text))))>0;
Thanks,
Vijay
Please click "Accept as Solution" if my post answered your question so that others may find it more quickly. If you found this post helpful consider giving it a "Thumbs Up."-Vijay
Please see below Patch Code
If(CountRows(Filter(Table1,"System Name"=DataCardValue1.Text)))>0;
Patch(Table1,Lookup(Table1,"System Name"=DataCardValue1.Text)),{'System Name':DataCardValue1.Text,'Model'=DataCardValue2.Text,'Current Status':"In Use"}),
Patch(Table1,Defaults(Table1),{'System Name':DataCardValue1.Text,'Model'=DataCardValue2.Text,'Current Status':"In Use"});Navigate(Screen1);ResetForm(Form1)
Thanks in advance,
Hi @Newbie12 ,
Can you please mentione the code here for this part mentioned by you?
The issue occurs when User 2 signup for Sys1. Though the row will be appended for "Sys1" in Excel Table. I am getting an extra tile for Sys1 in Screen 1. Below is the snippet of updated excel table after User 2 signup. Below is the code for Template fill,Gallery.Items property of Screen 1.
As per my Understanding, this part your patch Code has Some Issue. (Details mentioned above).
Basically in this Part, you need to Write Patch code for Update not for Create.
Please cross-check the code or update here so, I can suggest if I got someting .
Thanks,
Vijay
Please click "Accept as Solution" if my post answered your question so that others may find it more quickly. If you found this post helpful consider giving it a "Thumbs Up."-Vijay
WarrenBelz
791
Most Valuable Professional
MS.Ragavendar
410
mmbr1606
275
Super User 2025 Season 1