Skip to main content

Notifications

Power Apps - Building Power Apps
Unanswered

Power Apps Button OnSelect ad Power Apps Patch Funtion

(1) ShareShare
ReportReport
Posted on by 67
Hi Members,
 
I was developing a application for Desk Reservation. While developing it, I am stucked in. On the Power Apps screen divided into two containers, In 1st container, I have added a 9 button controls from Desk 1 to Desk 9. Also, in the second container added 9 button controls from Desk 1 to Desk 9.
 
In 1st container, Whenever the user selects a desk name as Desk 1, the color gets changed to white and in the second container "Desk 1" changed to green color, if they unselect the button in both container the color get backs to normal. The formula I used for container 1 for all desk buttons:
OnSelect :If(
          Find("Desk1,", varSelectedDesks) > 0, 
           // If Desk 1 is already selected, remove it from varSelectedDesks
           Set(varSelectedDesks, Substitute(varSelectedDesks, "Desk1,", "")),
           // If Desk 1 is not selected, add it to varSelectedDesks
           Set(varSelectedDesks, Coalesce(varSelectedDesks, "") & "Desk1,")
          );

Fill: If(
      Find("Desk1,", varSelectedDesks) > 0,
      Color.White,  // Turns white if Desk 1 is selected
      var_ThemeColor   // Default color (or any other color you prefer)
      )

Visible: If(
         !IsBlank(
          LookUp(
            'Desk Reservation Details_1',
            'Reservation Date' = DataCardValue3.SelectedDate &&
            'Desk Name' .Value= "Desk 1" &&
             'Reservation Status'.Value = "Booked"
           )
          ),
          false,true)
 


 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
Now the problem is,

In the SharePoint list, the Desk Name is a lookup column, so I made it it allows multiple selections, after that in the Container 1 all the button control is not visible. Please help me out how can I achieve this:
 
 
 

 
 
 
 
 
 
 
 
 
 
 
 
 
 
Question 1:  How to make it all the desk button control visible in Container 1.
Question 2:  In Container 1, How to save the selected button desk names to SharePoint list using patch function.

Please, Help me to resolve this? Thank You in advance!
  • WarrenBelz Profile Picture
    WarrenBelz 144,609 on at
    Power Apps Button OnSelect ad Power Apps Patch Funtion
    I assume this is all part of the issue in this thread ? Am I correct that varSelectedDesks is Text ? If so why are you trying to add it to a multi-select column (please answer on the other thread)

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

End of Year Newsletter…

End of Year Community Newsletter…

Tuesday Tip #12 Start your Super User…

Welcome to a brand new series, Tuesday Tips…

Tuesday Tip #11 New Opportunities…

Welcome to a brand new series, Tuesday Tips…

Leaderboard

#1
WarrenBelz Profile Picture

WarrenBelz 144,609

#2
RandyHayes Profile Picture

RandyHayes 76,287

#3
Pstork1 Profile Picture

Pstork1 64,420

Leaderboard