cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
LYNCHJL
Helper II
Helper II

Change Color of Form Field if it contains a word

How can I change the background color of a form field (multiline text) if it contains a word?

 

Thanks!

3 ACCEPTED SOLUTIONS

Accepted Solutions

Use:
If(!IsBlank(Find("abc",Textboxl.Text)),Green,Blue))

------------

If you like this post, give a Thumbs up. Where it solved your request, Mark it as a Solution to enable other users find it.

View solution in original post

v-xida-msft
Community Support
Community Support

Hi @LYNCHJL ,

Based on the needs that you mentioned, I agree with @eka24 and @WarrenBelz 's thought almost. You could take a try with them to achieve your needs.

 

As an another solution, I think the IsMatch function could achieve your needs. Please consider set the Fill property of the Text Input Box to following:

4.JPG

 

If(
   IsMatch(TextInputBox.Text, "Type Specific Word Here", MatchOptions.Contains),  // Replace TextInputBox with actual control name in your Edit form
   Color.Red ,                  // changed bg color
   RGBA(255, 255, 255, 1)    // defualt background color
)

 

 

Please consider take a try with above solution, then check if the issue is solved.

 

Best regards,

Community Support Team _ Kris Dai
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

Hi @LYNCHJL ,

I have tested mine on a model and it works - I have no doubt the others will also (there are many ways of doing the same thing).

Please tag whoever you want any further clarification from.

 

Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs Up.

View solution in original post

5 REPLIES 5
WarrenBelz
Super User III
Super User III

Hi @LYNCHJL ,

In the Fill of your Text control - substitute your word, control name and colour.

If(
   "YourWord" in YourTextBoxName.Text,
   YourColour,
   White
)

 note this will only show once the filed has been entered.

 

Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs Up.

Use:
If(!IsBlank(Find("abc",Textboxl.Text)),Green,Blue))

------------

If you like this post, give a Thumbs up. Where it solved your request, Mark it as a Solution to enable other users find it.

View solution in original post

v-xida-msft
Community Support
Community Support

Hi @LYNCHJL ,

Based on the needs that you mentioned, I agree with @eka24 and @WarrenBelz 's thought almost. You could take a try with them to achieve your needs.

 

As an another solution, I think the IsMatch function could achieve your needs. Please consider set the Fill property of the Text Input Box to following:

4.JPG

 

If(
   IsMatch(TextInputBox.Text, "Type Specific Word Here", MatchOptions.Contains),  // Replace TextInputBox with actual control name in your Edit form
   Color.Red ,                  // changed bg color
   RGBA(255, 255, 255, 1)    // defualt background color
)

 

 

Please consider take a try with above solution, then check if the issue is solved.

 

Best regards,

Community Support Team _ Kris Dai
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

Hi @LYNCHJL ,

I have tested mine on a model and it works - I have no doubt the others will also (there are many ways of doing the same thing).

Please tag whoever you want any further clarification from.

 

Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs Up.

View solution in original post

v-xida-msft
Community Support
Community Support

Hi @LYNCHJL ,

Have you taken a try with above solutions? Is it helpful in your scenario?

 

If you have solved your problem, please consider go ahead to click "Accept as Solution" to identify this thread has been solved.

 

Best regards,

Community Support Team _ Kris Dai
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Helpful resources

Announcements
PA_User Group Leader_768x460.jpg

Manage your user group events

Check out the News & Announcements to learn more.

Power Query PA Forum 768x460.png

Check it out!

Did you know that you can visit the Power Query Forum in Power BI and now Power Apps

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.

R2 (Green) 768 x 460px.png

Microsoft Dynamics 365 & Power Platform User Professionals

DynamicsCon is a FREE, 4 half-day virtual learning experience for 11,000+ Microsoft Business Application users and professionals.

Users online (1,695)