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

Check if Text Label contains string

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!!

 

1 ACCEPTED SOLUTION

Accepted Solutions
Anonymous
Not applicable

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! 

View solution in original post

2 REPLIES 2
Anonymous
Not applicable

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! 

View solution in original post

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

Helpful resources

Announcements
PA User Group

Welcome to the User Group Public Preview

Check out new user group experience and if you are a leader please create your group

secondImage

Demo Extravaganza Winner Announcement

Please join us on Wednesday, July 21st at 8a PDT. We will be announcing the Winners of the Demo Extravaganza!

V3_PVA CAmpaign Carousel.png

Community Challenge - Giveaways!

Participate in the Power Virtual Agents Community Challenge

Carousel 2021 Release Wave 2 Plan 768x460.jpg

2021 Release Wave 2 Plan

Power Platform release plan for the 2021 release wave 2 describes all new features releasing from October 2021 through March 2022.

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