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

Text color and format

Hello,

 

I have a very simple problem that somehow got me stuck! So I have this PowerApps user interface for corporate training with a box that shows the session time and whether it is available or full using a basic nested if-else. The code is as follows:

 

Text(
    ThisItem.'Start Time',
    "[$-en-US]ddd, mmm d, yyyy at hh:mm AM/PM CEST"
) & Text(
    "
"
) & If(
    ThisItem.Title = "Pitch Coaching - Basics",
    If(
        CountRows(ThisItem.Attendees) >= 2,
        Text("Session is FULL"),
        Text("Session is available")
    ),
    Text("Session is available")
)

 

So, if the session name is "Pitch Coaching - Basics" and it has 2 or more participants, it shows as "Session is FULL".

I want the word "FULL" to be red and bold --> Session is FULL 

 

It is a very basic problem, I know, and I even found some solutions online, but none of them seemed to work!!

I've tried the HTML code provided by @ZabiBabar in this post but it did not work.
I've tried the switch-if solution provided by @EricLott in this post but I think I did not implement it correctly.
I've also tried to follow the basic syntax TEXT(value, text_format, language) but it did not work either.

 

Please help.

1 ACCEPTED SOLUTION

Accepted Solutions
Super User III
Super User III

Hi @beshr1993

If you want this in one control, you need HTML, however if you want a low-tech solution - two labels - left one

Text(
    ThisItem.'Start Time',
    "[$-en-US]ddd, mmm d, yyyy at hh:mm AM/PM CEST"
) & Text(
    "
"
) &
"This Session is "

right one

If(
    ThisItem.Title = "Pitch Coaching - Basics",
    If(
        CountRows(ThisItem.Attendees) >= 2,
        "FULL",
        "available"
    ),
    "available")
)

Colour

If(Self.Text="FULL",Red,Black)

FontWeight

If(Self.Text="FULL",Bold,Normal)

 

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

2 REPLIES 2
Super User III
Super User III

Hi @beshr1993

If you want this in one control, you need HTML, however if you want a low-tech solution - two labels - left one

Text(
    ThisItem.'Start Time',
    "[$-en-US]ddd, mmm d, yyyy at hh:mm AM/PM CEST"
) & Text(
    "
"
) &
"This Session is "

right one

If(
    ThisItem.Title = "Pitch Coaching - Basics",
    If(
        CountRows(ThisItem.Attendees) >= 2,
        "FULL",
        "available"
    ),
    "available")
)

Colour

If(Self.Text="FULL",Red,Black)

FontWeight

If(Self.Text="FULL",Bold,Normal)

 

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

Got it. Thanks a lot 🙂

Helpful resources

Announcements
News & Announcements

Community Blog

Stay up tp date on the latest blogs and activities in the community News & Announcements.

Power Apps Community Call

Power Apps Community Call- January

Mark your calendars and join us for the next Power Apps Community Call on January 20th, 8a PST

PP Bootcamp Carousel

Global Power Platform Bootcamp

Dive into the Power Platform stack with hands-on sessions and labs, virtually delivered to you by experts and community leaders.

secondImage

Power Platform Community Conference On Demand

Watch Nick Doelman's session from the 2020 Power Platform Community Conference on demand!

Top Solution Authors
Top Kudoed Authors
Users online (11,139)