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 check if a valu...
Power Apps
Unanswered

How to check if a value of a row already exist in powerapps with multi select choice coulmn in dataverse table

(0) ShareShare
ReportReport
Posted on by 90

I  have a dataverse table definePromocycles  with Promocycle (Text Column) and Tiers(MultiSelect Choice Column) shown below 

Nida_Sayedi_0-1698047763955.png

Tiers Column Have ["Tier1","Tier2", "Tier3", "Tier4"] for which there is tierchoice option set

 

I have a form in powerapps where iam entering values in these columns, i need validation if I have entered an existing promocycle and Tiers value is should display some notification 

 

so i have used below code  On Onselect Property Of Submit Button

If(
!IsBlank(
LookUp(
DefinePromoCycles,
frmPromoCycle.Mode = FormMode.New && PromoCycle = DataCardValue31.Text && Concat(
'Tiers ',
Value,
","
) in DataCardValue33.Selected.Value
)
),
Notify(
"Duplicate Tier for the Cycle ",
NotificationType.Error
),
SubmitForm(frmPromoCycle)
);

 

here datacardValue33 is my combo box where i select multiple values

Nida_Sayedi_1-1698050305959.png

But Its working for a single values where i have multiple values within a row for Tiers Column

 

 Iam getting Notification Alert If I enter "Cycle 2" for PromoCycle  and Select Tier1 From ComboBox (Referring Table)

 

But Its failing If I enter  "Cycle 1" for PromoCycle  and Select 2 values Tier2  and Tier4 From ComboBox(Referring Table)

 

in general its failing if I select more than 1 value from combobox it should check if those two values for a single record exists and give me notifications , but if value exist its allowing ,me to enter it again which is wrong 

 

Plaese help how should I use choice column to compare multiple values , what code i need to write/Modify??

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

    Hi , @Nida_Sayedi 

    According to your description, you want to check if a value of a row already exist in PowerApps with multi select choice column in Dataverse table.

    I test it in my side , here are the steps you can refer to :
    (1)This is my test data in Dataverse Table:

    vyueyunmsft_0-1698120987697.png

    (2)We can use this code in Power Apps to judge if the selection exist in the Dataverse Table.

    Set(TestData,ForAll( ShowColumns( definePromocycles ,"cr667_promocyclie", "cr667_tiers" ) , {promocyclie:cr667_promocyclie, Tiers:
    Concat( Sort( ForAll(cr667_tiers As tt ,Text( tt.Value) ) ,Value) ,Value , ",") } ) );
    Set(PromoText, DataCardValue1.Text);
    Set(ComboSelected,Concat( Sort( ForAll( DataCardValue3.SelectedItems ,Text( Value)) ,Value) , Value,",") );
    Set(Flag ,!IsBlank( LookUp(TestData ,promocyclie = PromoText && Tiers =ComboSelected) ))

     

    The TestData is like this which is get the data from Dataverse:

    vyueyunmsft_1-1698121072924.png

    The result is as follows:

    vyueyunmsft_2-1698121094714.png

     

     

    Best Regards,

    Yueyun Zhang

     

     

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

Leaderboard > Power Apps

#1
11manish Profile Picture

11manish 405 Super User 2026 Season 2

#2
Mohsin Ali Profile Picture

Mohsin Ali 368

#3
WarrenBelz Profile Picture

WarrenBelz 244 Most Valuable Professional

Last 30 days Overall leaderboard