Hi Members,
I have a SharePoint list as "Desk Reservation Details", with a column: Desk Name [Lookup column], these column allows multiple values.
I was developing a application for Desk Reservation. On the Power Apps screen I have added a 9 button controls from Desk 1 to Desk 9. Whenever the user selects a button desk name as Desk 1 and Desk 2 and clicks on a Book Button control, those values should be saved to the SharePoint list.
For the each desk button control, The code I used 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)
In Book button control, OnSelect property, i have used the code as:
Patch('Desk Reservation Details_1',Defaults('Desk Reservation Details_1'),{Title:ReserveTitle,'Reservation Date':DataCardValue3.SelectedDate,'Reserved By':User().FullName,'Reservation Status':{Value:"Booked"},'Desk Name':varSelectedDesks})
But, I am facing the error as "Does not match expected type table, expected type text"

How to save the selected Desk button names to SharePoint list, if the user select Desk 1 and Desk 2.
Please, Help me how to achieve this. Thanks in Advance!