cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
beshr1993
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
WarrenBelz
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
WarrenBelz
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
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

Power Apps Community Call

Monthly Power Apps Community Call

Did you miss the call?? Check out the Power Apps Community Call here!

secondImage

Experience what’s next for Power Apps

See the latest Power Apps innovations, updates, and demos from the Microsoft Business Applications Launch Event.

Power Platform ISV STudio

Power Platform ISV Studio

ISV Studio is the go-to Power Platform destination for ISV’s to monitor & manage applications post-AppSource publish.

Top Solution Authors
Top Kudoed Authors
Users online (12,454)