Dear all,
I have to implement the following:
I have created a SP list named "FILTER list" with a choice column named "Timeslot" that have the following 3 options - 9am, 10am and 11am.
The form is an integrated PowerApps form.
I would like to remove the already selected options from the list. For eg. if I add a new entry with the option "9am" I would like to be removed from the dropdown list and to only show the other remaining options which are "10am" & "11am". (please see images for better clarification down below)
After
Form:
Thank you! Your help is very appreciated.
Hi, in case somebody will ever need this, I managed to adjust it by my own:
In PowerApps for the dropdown control:
OnSelect:
ClearCollect(col_Available_times,
{SlotTime:"9am",booked:LookUp('FILTER list',TimeSlot.Value = "9am").TimeSlot.Value},
{SlotTime:"10am",booked:LookUp('FILTER list',TimeSlot.Value = "10am").TimeSlot.Value},
{SlotTime:"11am",booked:LookUp('FILTER list',TimeSlot.Value = "11am").TimeSlot.Value}
)
Items:
Distinct(Filter(col_Available_times,IsBlank(booked)),SlotTime)
@WarrenBelz alright. Thank you for the responses !
Hi @Elizapnt ,
No idea sorry - there is only one way of doing this is you want to use a Choice field - otherwise you could hard-code the choices in Power Apps and do something like this (replace with your choices)
With(
{
_Choices:
[
"Alpha",
"Bravo",
"Charlie",
"Delta",
"Echo"
]
},
Filter(
_Choices,
!(Value in ThisItem.Timeslot.Value)
)
)
Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs Up.
MVP (Business Applications) Visit my blog Practical Power Apps
@WarrenBelz - Choice column - single value.
Yes, it is on the same record.
In my previous post I noticed that it works fine when I preview it on PowerApps but when I return in the SP list form and select an item, it doesn't apply anymore.
Seems like it has something to do with the scope?
I assume Timeslot is a Choice column in SharePoint - is it single or multiple value ? Also I asked whether you were testing the same record that the existing value is in - can you please confirm this. I also assume that the Combo Box is on a Form querying that record.
Hi again @WarrenBelz , just noticed that the filter seems to work fine on the form in PowerApps when I preview it but when I return to the SP list form it doesn't work anymore.
Do you have any idea why ?
Thank you for your help!
@WarrenBelz , yes on the "TimeSlot" column that I created in my SP list.
I noticed this in my formula and although it's not retrieving an error I am getting this message:
I just tested it here on both single selection and multiple selection choice fields and it worked exactly as expected on both. I assume you are testing this on the same record the selection is being made on.
Hi @WarrenBelz , thank you for your quick input.
I did the following but it does not change anything. The options are still available in the list although they are being selected.
I used the following in my PowerApps form in the Items:
Filter(
Choices([@'FILTER listt'].TimeSlot),
!(Value in ThisItem.TimeSlot.Value)
)
HI @Elizapnt ,
When you refer to "already selected", I assume you mean in the current record ? If so (and I assume this is a Choice field), it should be something like
Filter(
Choices('FILTER list'.Timeslot),
!(Value in ThisItem.Timeslot.Value)
)
Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs Up.
MVP (Business Applications) Visit my blog Practical Power Apps
WarrenBelz
146,658
Most Valuable Professional
RandyHayes
76,287
Super User 2024 Season 1
Pstork1
65,999
Most Valuable Professional