cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Frequent Visitor

Check equality of two combobox

Hi,

I need to check if the values of two combobox are the same before validate my form, but it seems like powerapps can't evaluate the value of two tables

Here is my code :

If(
    DataCardValue11.SelectedItems.Num_Parc = DataCardValue7.SelectedItems.Num_Parc;

    Notify(
        "Values can't be the same";
        NotificationType.Error
    );

    SubmitForm(myForm);
);;

The error comes on the equal sign : "Invalid argument type"

Thanks !

1 ACCEPTED SOLUTION

Accepted Solutions

@DrrickrypIt drop me an error : "Expected Text Value"

 

I found myself a solution by comparing the JSON value of each datacard : 

 

If(
    JSON(DataCardValue11.SelectedItems.Num_Parc) = JSON(DataCardValue7.SelectedItems.Num_Parc);

    Notify(
        "Values can't be the same";
        NotificationType.Error
    );

    SubmitForm(myForm);
);;

 

After many test, it seems to work well !

Anyways, thank for your answer 🙂

View solution in original post

2 REPLIES 2
Super User II
Super User II

Hi @BaptisteP 

If you put two labels on your screen with Text properties of   DataCardValue11.SelectedItems.Num_Parc  and DataCardValue7.SelectedItems.Num_Parc, respectively, what do you see in the labels?

@DrrickrypIt drop me an error : "Expected Text Value"

 

I found myself a solution by comparing the JSON value of each datacard : 

 

If(
    JSON(DataCardValue11.SelectedItems.Num_Parc) = JSON(DataCardValue7.SelectedItems.Num_Parc);

    Notify(
        "Values can't be the same";
        NotificationType.Error
    );

    SubmitForm(myForm);
);;

 

After many test, it seems to work well !

Anyways, thank for your answer 🙂

View solution in original post

Helpful resources

Announcements
New Badges

New Solution Badges!

Check out our new profile badges recognizing authored solutions!

New Power Super Users

Congratulations!

We are excited to announce the Power Apps Super Users!

Power Apps Community Call

Power Apps Community Call: February

Did you miss the call? Check out the Power Apps Community Call here.

Microsoft Ignite

Microsoft Ignite

Join digitally, March 2–4, 2021 to explore new tech that's ready to implement. Experience the keynote in mixed reality through AltspaceVR!

Top Solution Authors
Top Kudoed Authors
Users online (20,066)