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

Filter Drop down for selected item (HELP)

Hi,

I created gym pass when user booking they need to select date,slot (AM/PM) and card. Since for every time slot (Date and AM/PM slot) there only have 5 cards availability. 
I want to make card(s) selected are dissapear when it already booked for each unique time and slot 

for example :

user(s) already book card 1 & 2 at 26/11 AM --> then when other user try to book at same time and slot (26/11-AM) dropdown card will only show card 3,4 & 5

user already book card 5 at 27/11 PM --. then when other user try to book at same time and slot(27/11-PM) drop down card will only show card 1,2,3,4

Can help what filter command i should use , help really appreciated

 

here is my apps and sharepoint table looks
Capture.JPGgym pass SP.JPGGym card SP.JPG

1 ACCEPTED SOLUTION

Accepted Solutions
Community Support
Community Support

Hi@laurent_rio,


@laurent_rio wrote:

Hi @v-qiaqi-msft 

Care to explain what is the command  language in general , i dont understand especially on the part of 
card.value & ";" 


That's a part of the Concat() fucntion. 

The Filter() function helps filter two records based on the date and slot, and the filtered records are exactly in a nested table for we create the Lookup column to store the cards values. Therefore the Concat() function helps concatenates the result of a formula applied across all the records of a table. For more details, you could check here for reference:

https://docs.microsoft.com/en-us/powerapps/maker/canvas-apps/functions/function-concatenate

So glad that we finally solve it, please mark my solution as an answer.

Best Regards,

Qi

View solution in original post

13 REPLIES 13
Community Support
Community Support

Hi@laurent_rio,

Based on the issue that you mentioned, do you want to make the selected Card unique for a specific time period?

Could you please share a bit more about the scenario, what is the column type of the Card column, Lookup type?

I assume that the Card column is a Lookup type.

Connect both 'Gym Pass' and 'GymCardList' to your App.

26.png

Set the Items property of the Dropdown corresponding to the Card column as below:

 

Filter(
    GymCardList,
    !(LookUp(
        'Gym Pass',
        Date = DataCardValue6.SelectedDate && Slot.Value = DataCardValue7.Selected.Value
    ).Card.Value in Card)
)

 

Note: The DataCardValue6 represents the DatePicker and DataCardValue7 represents the Combo Box corresponding to the 'Slot'.

Since I found that you choose a Dropdown to select Card value, so I think the only one card is allowed to select at one time by default.

112601Gif.gif

Hope it could help.

Best Regards,

Qi

 

 

 

Helper I
Helper I

Hi @v-qiaqi-msft 
i just create LOOKUP two sharepoint list (Gym Pass and GymCardList), but then i cant patch the card dropdown and the command 

Filter(
    GymCardList,
    !(LookUp(
        'Gym Pass',
        Date = DataCardValue6.SelectedDate && Slot.Value = DataCardValue7.Selected.Value
    ).Card.Value in Card)
)

also not work, no dropdown card items appear at all

Do i wrongly lookuop ? so i create new column Card in Gym Pass that connect to card in GymCardlist.
Do i make mistake in linking sp list ?
Capture.JPG

sg.JPGCapture.JPG

Community Support
Community Support

Hi@laurent_rio,

Could you please tell me that how you set the Combo Box corresponding to the Card?

The DataCardValue6 represents the DatePicker and DataCardValue7 represents the Combo Box corresponding to the 'Slot'.

These controls' names are in my scenario, you should replace them with the real ones in your App.

Please try the formula again and replace the control with yours. 

Best Regards,

Qi

Helper I
Helper I

Hi @v-qiaqi-msft ,
yes i enter with my datacardvalue real number 

Filter('Gym Card List',!LookUp('Gym Pass',Date=DataCardValue10.SelectedDate&&Slot=DataCardValue14.Selected.Value).Card.Value in Card)

you also can see in the picture, on left side the datacard for date and slot. The only different is i cant enter the command as slot.value , i enter directly as slot.
there is no error but no items appear at dropdown


What do i miss ? Do you think i should tweak the default properties of dropbox ? currently there is no default properties

Capture.JPG

Community Support
Community Support

Hi@laurent_rio,

Could you please tell me the column type of the Slot, is it a Choice?

If it is Choice, you should set the Items property of the Dropdown corresponding to the Card column as below:

 

Filter(
    Choices('Gym Pass'.Card),
    !(LookUp(
        'Gym Pass',
        Date = DataCardValue10.SelectedDate && Slot.Value = DataCardValue14.Selected.Value
    ).Card.Value = Value)
)

 

And please do remember to set the Update property of the data card as below:

 

Dropdown2.Selected

 

Note: Dropdown2 is the control corresponding to the Card column.

 

29.png30.png

In my scenario, I set the Slot a Choice and the Card a Lookup column.

Best Regards,

Qi

Helper I
Helper I

Hi @v-qiaqi-msft 

in my sharepoint list, I set the slot only as single text column and card a lookup column

I input the items in Slot dropdown box manually ["AM","PM"]

So is there any tweak for this text column or i must change to choice column ?

Community Support
Community Support

Hi@laurent_rio,

From this screenshot, this Slot is a typically Choice column. At this situation, you should set the Items property of the Slot Dropdown as "Choices([@'Gym Pass'].Slot)" rather than the "["AM","PM"]".

31.png

Anyway, I will provide the workaround if you have the Text type for the Slot column.

 

 

Please make sure that set the Update property of the Slot data card as below:

 

Dropdown1.Selected.Value

Note: The Dropdown1 represents the Slot.

Set the Items property of the Card Dropdown as below:

Filter(Choices('Gym Pass'.Card),!(LookUp('Gym Pass',Date=DataCardValue6.SelectedDate&&Slot=Dropdown1.Selected.Value).Card.Value=Value))

Note: DataCardValue6 represents the DatePicker for the Date.

Set the Update property of the Card data card as below:

DataCardValue8.Selected

Note: DataCardValue8 represents the Card Dropdown.

32.png

 

Hope it could help.

Qi

 

Helper I
Helper I

Hi @v-qiaqi-msft 
I think something wrong that it still cant work 

 

Filter(Choices('Gym Pass'.Card),!LookUp('Gym Pass',Date=DataCardValue10.SelectedDate&&Slot=DataCardValue6.Selected.Value).Card.Value=Value)

 

In the apps i test using label to display 
Datacardvalue10.selecteddate (date selected) and datacardvalue6Capture.JPG.selected.value(slot selected). It appear on label bottom.
 



Community Support
Community Support

Hi@laurent_rio,

Could you please tell me that:

  1. how you set the Update property of the Slot and Card data card
  2. how you create this app, generate it directly based on the SP list?

Please do provide the screenshot of the Items property of the 2 Combo Box, and Update property of the 2 data card.

If the Slot column is a real Text type within your SP list, try to set the Items property of the Slot as below:

Distinct('Gym Pass',Slot)

Modify the formula within the Items property of the Card Combo Box as below:

Filter(
    Choices('Gym Pass'.Card),
    !(LookUp(
        'Gym Pass',
        Date = DataCardValue6.SelectedDate && Slot = Dropdown1.Selected.Result
    ).Card.Value = Value)
)

Here is GIF of my app, please check for reference.113001Gif.gif

 

Best Regards,

Qi

 

Helpful resources

Announcements
News & Announcements

Community Blog

Stay up tp date on the latest blogs and activities in the community News & Announcements.

Power Apps Community Call

Power Apps Community Call- January

Mark your calendars and join us for the next Power Apps Community Call on January 20th, 8a PST

PP Bootcamp Carousel

Global Power Platform Bootcamp

Dive into the Power Platform stack with hands-on sessions and labs, virtually delivered to you by experts and community leaders.

secondImage

Power Platform Community Conference On Demand

Watch Nick Doelman's session from the 2020 Power Platform Community Conference on demand!

Top Solution Authors
Top Kudoed Authors
Users online (7,193)