cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
sarath_123
Level: Powered On

Compare two values in label

Hi Team,

Happy New Year all!
I have an Attachment Box (DataCardValue) where I can browse and attach files, I have a Drop down which has country names, The files to be attached will have the country name in their suffix eg: (Data_Spain.Xlsx), I need to check if the Dropdown selected value matches the name in the file attachment.

For this I have created 2 label - fetching the Filename from attachment and displaying in 1 label and fetching the dropdown selected value and displaying in another label.


tpp.JPG

 

Now I need to compare these 2 Label and check if the country name is present in the Filename to be attached. If matches allow user to upload if not matches say not to upload.

 

I tried ISMATCH funtion but no help.

Any other possibilities ?Thanks-Sarath

1 ACCEPTED SOLUTION

Accepted Solutions
gabibalaban
Level 8

Re: Compare two values in label

@sarath_123 

Set DisplayMode property of a button to:

If (Label2.Text in Label1.Text, DisplayMode.Edit, DisplayMode.Disabled)

 

In this way you can be sure that the user cannot use the button if your condition isn't met.

 

Additionally you can put a label with something similar in Text property.

If (Label2.Text in Label1.Text, "","Upload blocked ! Check the filename or select a different country !")

View solution in original post

4 REPLIES 4
JesperHuang
Level: Powered On

Re: Compare two values in label

Hi @sarath_123 ,

 

Did you modify "Match options" in IsMatch function?

Default is "Complete", in your scenario should use "Contains", hope this help!

 

IsMatch( your_file_name, "Spain", Contains )

 

gabibalaban
Level 8

Re: Compare two values in label

@sarath_123 

Set DisplayMode property of a button to:

If (Label2.Text in Label1.Text, DisplayMode.Edit, DisplayMode.Disabled)

 

In this way you can be sure that the user cannot use the button if your condition isn't met.

 

Additionally you can put a label with something similar in Text property.

If (Label2.Text in Label1.Text, "","Upload blocked ! Check the filename or select a different country !")

View solution in original post

sarath_123
Level: Powered On

Re: Compare two values in label

Thank you ! 
Here "Spain" will not be a constant value always.

It will get dynamic from the Country Dropdown.

Thanks-Sarath 

sarath_123
Level: Powered On

Re: Compare two values in label

If (Label2.Text in Label1.Text, DisplayMode.Edit, DisplayMode.Disabled)

This worked - Thank you 

Helpful resources

Announcements
thirdimage

Power Apps Super User Class of 2020

Check it out!

thirdimage

New Badges

Check it out!

thirdimage

Power Apps Community User Group Member Badge

Fill out a quick form to claim your user group badge now!

sixthImage

Power Platform World Tour

Find out where you can attend!

Power Platform 2019 release wave 2 plan

Power Platform 2019 release wave 2 plan

Features releasing from October 2019 through March 2020

SecondImage

Difinity Conference

The largest Power BI, Power Platform, and Data conference in New Zealand

Top Solution Authors
Top Kudoed Authors
Users online (4,966)