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 / Comparing comboBox sel...
Power Apps
Answered

Comparing comboBox selected Item with choice column values

(0) ShareShare
ReportReport
Posted on by 45

Hi!
I need to avoid a user to patch values in a choice column if such values already exist. 

In other words, I need to get the selectedItems in a combobox and check if they already exist in a choice colum (in SharePoint list).

 

It seems easy...but I have been trying this for over 4 days! loool
Any tips?

Thanks a lot in advance!

Categories:
I have the same question (0)
  • alaabitar Profile Picture
    1,503 Super User 2024 Season 1 on at

    Hello,

     

    You can activate the enforce unique values at the column level in sharepoint.

    alaabitar_0-1660572840119.png

     

    Best regards,

    Alaa

  • wagnerortizz Profile Picture
    45 on at

    Yeh..Thanks a lot..
    I believe it desnt work to me because indeed I cant have the same value, but only coming from the same person...
    Person A can only choose "Orange" once. If he/she tries to choose "Orange" again, I block.

    But person B can still choose his/her "Orange". Thats why I am gonna have repeated value in the colum, but not coming from the same person....gotcha?

  • wagnerortizz Profile Picture
    45 on at

    The problem I am facing is because Choice Column return registers. So each option/each choice is a register. But in ComboBox, each choice is a Table. And that is driving me crazy...cuz I need to compare them, but can't   

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

    Hi @wagnerortizz ,

     

    Does your choice column allow multiple selection? 

    I did a simple test with a choice column that doesn't allow multiple selections for your reference. 

    I put all the existing options into a collection before submitting the data, and then determine whether the current option is in the collection. 

     

    1. Here is my List. 

    vyujincuimsft_0-1660722089402.png

     

    2. Here is my App. 

    ClearCollect(collectionname,Distinct(AddColumns(datasource,"newcolumnname",ChoiceColumn.Value),newcolumnname)); 
    If(Form1.Mode=FormMode.New,If(DataCardValue9.Selected.Value in collectionname,Notify("Please choose another option"),SubmitForm(Form1)),SubmitForm(Form1)) 

    vyujincuimsft_1-1660722089408.png

    Result Screenshot: 

    vyujincuimsft_2-1660722089411.png

     

     

    Best Regards, 
    Charlie Choi 

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

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Users!

Kudos to our 2025 Community Spotlight Honorees

Congratulations to our 2025 community superstars!

Congratulations to the March Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
11manish Profile Picture

11manish 534

#2
WarrenBelz Profile Picture

WarrenBelz 416 Most Valuable Professional

#3
Valantis Profile Picture

Valantis 306

Last 30 days Overall leaderboard