web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / Changing font color of...
Power Apps
Unanswered

Changing font color of partial texts in sentence

(0) ShareShare
ReportReport
Posted on by 15

Hi 

 

I was looking for an solution.Any way to Changing the font colour of partial texts based on start and end index. And the sentence starting and ending index are obtained from collections( API response are stored in collections)

 

Example context : David visited the restaurant yesterday. David again visited today and hoped to visit again tomorrow 

 

Collection: 

Date                 Start     End

2021/02/10    30           48

2021/02/11      61         65

2021/02/12      91         98

 

Expected Output: David visited the restaurant yesterday. David again visited today and hoped to visit again tomorrow 

 

Categories:
I have the same question (0)
  • RandyHayes Profile Picture
    76,297 Super User 2024 Season 1 on at

    @Arthy_A26 

    To change font colors (and other aspects) you need to utilize the HtmlText control.

    So in your example (not sure how the logic relates to your collection data, but I'm sure you have that worked out) your htmltext would be:

    "David visited the restaurant <font color='red'>yesterday</font>. David again visited <font color='red'>today</font> and hoped to visit again <font color='red'>tomorrow</font>"

     

    I hope this is helpful for you.

  • Arthy_A26 Profile Picture
    15 on at

    Hy @RandyHayes 

     

    Actually API response i stored in collection will vary based on user filled out in textbox. and also i want to change the font color based on the index values

     

    Let me put this simpler. 

    For example User enters context that contains yesterday,today,tomorrow like above mentioned example

    so api response that im getting will be like 

     

    DateStart indexEnd Index
    11-02-20206165
    12-02-20209198
    10-02-20203048

    im storing this api response to collection

     

    so now what im looking for is to change the font color from the index 61 to 65 and 91 to 98 and 30 to 48 only

     

    and my output will  David visited the restaurant yesterday. David again visited today and hoped to visit again tomorrow 

  • RandyHayes Profile Picture
    76,297 Super User 2024 Season 1 on at

    @Arthy_A26 

    I am sorry, I am not understanding any connection of start and end index number and a date and users entering yesterday today and tomorrow to anything.  There is no connection at all (in my interpretation of your message) to the sentence you are providing.  What does 61 to 65 have to do with David visiting the restaurant yesterday, today or tomorrow or anything?

  • Arthy_A26 Profile Picture
    15 on at

    Capture1.PNG

    This is how UI looks like. When I click test button it trigger API which identifies date field with starting and ending position in the given context and api response (dates) stored in collection 

     

    now im looking for solution to highlight the dates in given context using start and end index from collection

  • RandyHayes Profile Picture
    76,297 Super User 2024 Season 1 on at

    @Arthy_A26 

    I would suggest a Replace function then, but your index numbers do not correlate to the text.

    Based on your image, 29 to 37 is "t yester" and 20 to 24 is "rest"

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

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 796 Most Valuable Professional

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 327 Super User 2025 Season 2

#3
Power Platform 1919 Profile Picture

Power Platform 1919 268

Last 30 days Overall leaderboard