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

Using the Substitution function to Substitute a Variable Value with HTML Code into a HTML Text Box

I want to use the Substitute function to substitute the targeted word in an HTML Text Box string with the value of a variable tied to a Textinput Field. For instance, the Textinput Field assigns the value of the variable named "varSubsitution" with the string "house". I then want to use the Substitute function to replace the string "home" in the HTML Text Box with the variable value "house". The text in the HTML Text Box is black. To make the string "house" stand out I want its font to be blue. The formula I came up with for the HTML Text Box is: HtmlText = Substitute(Parent.Default,"home", "<b><font color=blue>varSubstition</font></b>"). The problem is that instead of substituting the variable value "house" for "home" in the HTML Text Box, the Substituition function substitutes the actual string "varSubstition". What would be the formula that would substitute the value of the variable "varSubstition" for "home" instead of the string "varSubstition"?  TIA. Bruce.

1 ACCEPTED SOLUTION

Accepted Solutions
timl
Super User
Super User

Hi @brucegil 

I think this is what you're looking for...

 Substitute(Parent.Default,
            "home", 
            "<b><font color=blue>" & varSubstition & "</font></b>"
)

View solution in original post

2 REPLIES 2
timl
Super User
Super User

Hi @brucegil 

I think this is what you're looking for...

 Substitute(Parent.Default,
            "home", 
            "<b><font color=blue>" & varSubstition & "</font></b>"
)
brucegil
Frequent Visitor

Tim, your right.  Thanks for the prompt response.  I always have problems with those pesky double quotes and ampersands

Helpful resources

Announcements
Power Apps News & Annoucements carousel

Power Apps News & Announcements

Keep up to date with current events and community announcements in the Power Apps community.

Community Call Conversations

Introducing the Community Calls Conversations

A great place where you can stay up to date with community calls and interact with the speakers.

Power Apps Community Blog Carousel

Power Apps Community Blog

Check out the latest Community Blog from the community!

Top Solution Authors
Top Kudoed Authors
Users online (5,249)