web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / Allow only one item of...
Power Apps
Answered

Allow only one item of a catergory in the collection

(1) ShareShare
ReportReport
Posted on by 384

Hi all,

 

i have a shop with 4 categories (cat1, cat2, cat3, cat4)

I want the users only allow to order 1 item of cat1 but as many as they want from cat2, cat3, cat4

I have this on my shopping tray icon:

DisplayMode: If(LookUp(basket,itemcat=Gallery4.Selected.Category,itemcat)="cat1"),Disabled,DisplayMode.Edit)

 

BUT, when I switch to another category in my shop, put an item in my collection("basket") and switch back to cat1, I am able to buy another item of cat1.

 

How can I fix that?

Categories:
I have the same question (0)
  • iAm_ManCat Profile Picture
    18,256 Most Valuable Professional on at

    Hi!

     

    When you change the category, your selected item in that gallery is going to change, which then makes your formula allow it as its looking at that selected item from the gallery.

     

    You could try counting the number of rows in your basket containing cat1 and if that is > 0 then disable it:

     

    DisplayMode:

    If(
     CountRows(Filter(basket,itemcat="cat1")) > 0,Disabled,DisplayMode.Edit
    )

     

    Could you try this and let me know if you encounter any issues?

     

    Thanks,

    Sancho

  • Frankie70 Profile Picture
    384 on at

    Hi @iAm_ManCat 

    thanks for your answer.

    Unfortunately I can not put anything of the other categories in the basket, because there is already one item of cat1 in the collection, and so it is disabled 😞

    Any other idea?

  • Verified answer
    iAm_ManCat Profile Picture
    18,256 Most Valuable Professional on at

    Yeah, that makes sense - and yes we absolutely can change it

     

     

    If(
     Gallery4.Selected.Category="cat1"
     &&
     CountRows(Filter(basket,itemcat="cat1")) > 0,
     Disabled,DisplayMode.Edit
    )

     

     

    So if there is already on in the basket (countrows) and the current selected one is cat1, then disable, otherwise enable it

  • Frankie70 Profile Picture
    384 on at

    Thanks a lot, that did the trick!

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

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Congratulations to the July Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 396 Most Valuable Professional

#2
11manish Profile Picture

11manish 134 Super User 2026 Season 2

#3
MS.Ragavendar Profile Picture

MS.Ragavendar 101 Super User 2026 Season 2

Last 30 days Overall leaderboard