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

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / Restrict Duplicate Ent...
Power Apps
Unanswered

Restrict Duplicate Entries - Combo Boxes

(0) ShareShare
ReportReport
Posted on by

Good day,

I have a powerapps form with several combo box entries all linked to the same data source.

Basically, I want the user to enter the number of services he is requesting approval for, the list of services is the same.

Is there any way to, once a user has selected a service in the first entry, limit them from selecting the same service again?

Below is a my code and attached image, couldn't really find anything online on this

Any help is appreciated

This is my code all the combo boxes:

 SortByColumns( Distinct ('01. CASH_SERVICES', SERVICE ), "Result" , Ascending)

Image attached for reference

Categories:
I have the same question (0)
  • Edwin-Abdalian Profile Picture
    641 on at

    This is how I would do it, but someone might have a different approach

     

    1- You need to have a collection to store the selected values and also you should know which ComboBox was used to hold that value. So create a collection on the Start of your App or on the Visible of your screen:

    ClearCollect(colSelectedStates, {SelectedState: "-" , ID: 0}) This is a dummy value. I'm using States instead of Services in my example

    2- Every time you set a ComboBox (Make sure the SelectedMultiple = false) you need to remove the previous value in the collection and set the new one:

    OnChange of every combo box: 

    Remove(colSelectedStates, LookUp(colSelectedStates, ID =1) );
    Collect(colSelectedStates, {SelectedState: cmbState1.Selected.State , ID: 1})

    your next ComboBox should have ID 2, and so on

     

    3- Set the Items of each ComboBox to: Filter(EntityB.State, !(State in colSelectedStates.SelectedState)) this makes sure that the value has not been selected before. EntityB is my entity, change it with your datasource

     

    Feel free to ask more questions.

    --------------------------------------------------------------------

    Please Accept as Solution if this post answered your question so other members can find it. If you found this post helpful consider giving my post a Thumbs Up!

  • Community Power Platform Member Profile Picture
    on at

    Thank you for the detailed response

    I will try your solution and let you know how it goes 😃

    Have a good day ahead !!

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

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 721 Most Valuable Professional

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 320 Super User 2025 Season 2

#3
Power Platform 1919 Profile Picture

Power Platform 1919 268

Last 30 days Overall leaderboard