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 / How to restrict user t...
Power Apps
Answered

How to restrict user to select different types of Status in combobox

(0) ShareShare
ReportReport
Posted on by 158

Hi ALL,

 

I need your help to find solution of one scenario.

 

I have a Delivery table which is below:

Delivery ItemStatus
1Delivered
2Rejected
3InProgress
4Delivered

 

I have a multi select combo box in which delivery items are appeared in dropdown. Now my issue is how to restrict user to not to select items having different status. Like Item 1,2,3 can never be selected together because they have different status. But Item 1 and 4 can be selected together as they same status. Not sure if this is possible or not in PowerApps.

 

 

Categories:
I have the same question (0)
  • v-yueyun-msft Profile Picture
    Microsoft Employee on at

    Hi ,  @ridhan 

    This is my test data in Power Apps:

    ClearCollect(testData,{Item:"1",Status:"Delivered"},{Item:"2",Status:"Rejected"},{Item:"3",Status:"Inprogress"},{Item:"4",Status:"Delivered"},{Item:"6",Status:"Rejected"})
     
    Combo box -items:   testData

    We can set the Combo box -OnChange property:
    Set(SelectedData , Distinct( ComboBox2.SelectedItems ,Status ) ); If( CountRows(SelectedData)>1 ,Notify("You can just select one status");Reset(Self) );​

    The result is as follows , if we select 1 and 2: 

    vyueyunmsft_1-1710312844347.png

     

    If this reply can help you , you can click mark this reply as solution (Accept solution) which can help more people, thanks in advance! 

     

    Best Regards,

    Yueyun Zhang

     

     

     

     

  • scalca Profile Picture
    on at

    I would go with filtering them out from the items collection
    try this
    I used a collection for the combobox items property called colItems, where there is DeliveryItem and Status
    on the combobox onselect property I'm using another collection 
    ClearCollect(colStatus, Self.Selecteditems.Status), which is going to collect the Status property of the selected items
    the combobox items property has the following:

    Filter(colItems, Not(Status in colStatus))
    whenever an item exists with same status and one of them was selected it will disappear from the list since one item was already selected with that status.

  • Verified answer
    ridhan Profile Picture
    158 on at

    Hi @v-yueyun-msft - Thank you for your suggestion. But my requirement i we can select multiple items with same status. It just saved status items can not be selected with Rejected or inprogress.

     Combination can be selected:

    1. Multiple Rejected and Multiple Inprogress

    2.Multiple Saved

     

     

  • v-yueyun-msft Profile Picture
    Microsoft Employee on at

    Hi , @ridhan 

    Thanks for your reponse! Yes, in my understand , it can select 1 and 4  which status is all "Delivered" in my test app:

    vyueyunmsft_0-1710313757733.png

    Best Regards,

    Yueyun Zhang

     

     

  • ridhan Profile Picture
    158 on at

    Hi @v-yueyun-msft and @scalca - sorry for not providing details properly!

    user can select multiple status and items from combo box.

    • But if user is selecting Delivered status that can be only selected with Delivered status items. It can be multiple or single.
    • Rest all status can be selected in combination for single or multiple items.

    Hope i am able to explain the scenario now.

     

  • v-yueyun-msft Profile Picture
    Microsoft Employee on at

    Hi , @ridhan 

    Thanks for response! Do you mean your judgement only for the Delivered status? Other Status can be selected in combination for single or multiple items?

    vyueyunmsft_0-1710314734850.png

    Like this , we can select 2,3  but we can not select 2,3,4?

     

    Best Regards,

    Yueyun Zhang

     

  • ridhan Profile Picture
    158 on at

    Hi @v-yueyun-msft - yes, we can select 2,3 together but if user select 2,3,4 it will reset the combo box.

     Only Delivered status can de selected alone. Rest all (rejected/inprogress) can be selected in combination.

     

    Thanks for your help so far!

  • Verified answer
    v-yueyun-msft Profile Picture
    Microsoft Employee on at

    Hi , @ridhan 

    You can try to use this code in Combo box - OnChange:

    Set(SelectedData , Distinct( ComboBox2.SelectedItems ,Status ) ); If( CountRows(SelectedData)>1 && "Delivered" in SelectedData ,Notify("You can just select one status");Reset(Self) );
     
     

    If this reply can help you , you can click mark this reply as solution (Accept solution) which can help more people, thanks in advance! 

     

    Best Regards,

    Yueyun Zhang

     

  • ridhan Profile Picture
    158 on at

    Hi @v-yueyun-msft - yes it worked. Thanks for all your help!

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 June Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 294 Most Valuable Professional

#2
11manish Profile Picture

11manish 210

#3
Valantis Profile Picture

Valantis 169

Last 30 days Overall leaderboard