cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
migueldctech
Helper I
Helper I

Visible button

I have a button that i would like to be visible if the text in a datacardvalue contains 1Z, otherwise dont show that button

1 ACCEPTED SOLUTION

Accepted Solutions
Pstork1
Dual Super User
Dual Super User

put the following in the Visible property of the button

If("1Z" in DataCardValue1.Text,true,false)


-------------------------------------------------------------------------
If I have answered your question, please mark your post as Solved.
If you like my response, please give it a Thumbs Up.

Join me at 365EduCon in Chicago on Sept. 26-30 where I'll be presenting on the Power Platform!

View solution in original post

7 REPLIES 7
timl
Super User
Super User

Hi @migueldctech 

You could do this by setting the Visible property of the button to:

(DatacardValue.Text = "1Z")
chmoncayMSFT
Power Apps
Power Apps

Hi there,

 

You can use this formula:

(TextInput1.Text exactin "1Z")

 

This will make sure that it's exactly 1 and capital Z, if lowercase z is OK you can use this

(TextInput1.Text in "1Z")

 

Additionally,

 

If you need to find 1Z in a string like THMSX1ZSJED, you can use:

Find(TextInput1.Text,"1Z")

 

Hope this helps!

Pstork1
Dual Super User
Dual Super User

put the following in the Visible property of the button

If("1Z" in DataCardValue1.Text,true,false)


-------------------------------------------------------------------------
If I have answered your question, please mark your post as Solved.
If you like my response, please give it a Thumbs Up.

Join me at 365EduCon in Chicago on Sept. 26-30 where I'll be presenting on the Power Platform!
RandyHayes
Super User
Super User

@migueldctech 

Set your Visible property on the Button to : 

   "1Z" in DataCardValuex.Text  Replace control name with your control name.

 

I hope this is helpful for you.

_____________________________________________________________________________________
Digging it? - Click on the Thumbs Up below. Solved your problem? - Click on Accept as Solution below. Others seeking the same answers will be happy you did.
NOTE: My normal response times will be Mon to Fri from 1 PM to 10 PM UTC (and lots of other times too!)
Check out my PowerApps Videos too! And, follow me on Twitter @RandyHayes

Really want to show your appreciation? Buy Me A Cup Of Coffee!
RandyHayes
Super User
Super User

@migueldctech 

Just keep in mind that you don't need the redundant true and false and an If in a true/false boolean property.  The main part of that formula will already be true or false, adding an If statement to say if something is true, then true, is redundant.  

Just a few less typing steps needed!

_____________________________________________________________________________________
Digging it? - Click on the Thumbs Up below. Solved your problem? - Click on Accept as Solution below. Others seeking the same answers will be happy you did.
NOTE: My normal response times will be Mon to Fri from 1 PM to 10 PM UTC (and lots of other times too!)
Check out my PowerApps Videos too! And, follow me on Twitter @RandyHayes

Really want to show your appreciation? Buy Me A Cup Of Coffee!
timl
Super User
Super User

@migueldctech 

The others are of course correct - I misread "contains" for equals.

The comment I would have about Randy's formula is that it shortcuts the If statement and is therefore more succint.

Thank you so much, now i can set different buttons for tracking purposes, like UPS/FEDEX.........hahahah...it works, thank you again.

 

Miguel

Helpful resources

Announcements
Power Platform Conf 2022 768x460.jpg

Join us for Microsoft Power Platform Conference

The first Microsoft-sponsored Power Platform Conference is coming in September. 100+ speakers, 150+ sessions, and what's new and next for Power Platform.

Users online (4,850)