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

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
Super User II
Super User II

@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
Helper I
Helper I

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 )

 

Super User II
Super User II

@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

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

It will get dynamic from the Country Dropdown.

Thanks-Sarath 

Frequent Visitor

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

This worked - Thank you 

Helpful resources

Announcements
News & Announcements

Community Blog

Stay up tp date on the latest blogs and activities in the community News & Announcements.

Power Apps Community Call

Power Apps Community Call- January

Mark your calendars and join us for the next Power Apps Community Call on January 20th, 8a PST

PP Bootcamp Carousel

Global Power Platform Bootcamp

Dive into the Power Platform stack with hands-on sessions and labs, virtually delivered to you by experts and community leaders.

secondImage

Power Platform Community Conference On Demand

Watch Nick Doelman's session from the 2020 Power Platform Community Conference on demand!

Top Solution Authors
Top Kudoed Authors
Users online (10,115)