Skip to main content

Notifications

Community site session details

Community site session details

Session Id :
Power Apps - Building Power Apps
Answered

Check if Text Label contains string

Like (1) ShareShare
ReportReport
Posted on 27 Jun 2019 10:27:02 by 42

Hi Everyone

 

I need help with a particular piece of functionality which is stalling my progress!

 

Here is my scenario for a Accident Reporting App:

 

- I have a picture of a body, with multiple buttons overlaid

- Each button represents a body part, e.g. Head, Hand, Foot etc

- I have a separate Combobox which contains a list of all potential body parts, which permits multi selection

- I have a Text Label which then takes all selections and displays them with separators using the following formula in the TEXT property:

 

Concat(ComboBox.SelectedItems,Value & ";")

 

- So when I select HEAD and HAND from the combobox, I get the Text string "Head;Hand" in the label

- I now want the button FILL to change to Red from Transparent when the item has been selected. A similar formula for a simple Dropdown with a single selection for "Head" would be:

 

If(TextLabel.Text = "Head",Red,Transparent)

 

How can I check the text label for any part of a defined string, so for the head fill, I would be looking at TextLabel.Text for "Head;" anywhere in the string

 

My next challenge will then be working out how to then hide the Combobox and update the selection from the button press using a variable, but one step at a time I hope!

 

Any help would be appreciated!!

 

  • HendosMark Profile Picture
    42 on 27 Jun 2019 at 10:41:51
    Re: Check if Text Label contains string

    Amazing, super simple when you know how! Thanks for your help @Anonymous !

  • Verified answer
    Community Power Platform Member Profile Picture
    on 27 Jun 2019 at 10:37:52
    Re: Check if Text Label contains string

    Hello @HendosMark ,

     

    Please have a look at the Find Function

     

    Use this function for your Label fill : If(!IsBlank(Find("Head",TextLabel.Text)),Red,RGBA(0, 0, 0, 0))

     

    Hope this helps! 

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

Understanding Microsoft Agents - Introductory Session

Confused about how agents work across the Microsoft ecosystem? Register today!

Warren Belz – Community Spotlight

We are honored to recognize Warren Belz as our May 2025 Community…

Congratulations to the April Top 10 Community Stars!

Thanks for all your good work in the Community!

Leaderboard > Power Apps - Building Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 83 Most Valuable Professional

#2
MS.Ragavendar Profile Picture

MS.Ragavendar 54

#3
mmbr1606 Profile Picture

mmbr1606 41 Super User 2025 Season 1

Overall leaderboard