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

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / Sallery is connected ...
Power Apps
Suggested Answer

Sallery is connected to a SharePoint list in GCC

(1) ShareShare
ReportReport
Posted on by 2

I need to show a horizontal rectangle in a gallery where Width = DateDiff(Today(), AwardDate, Days)/2. The gallery is connected to a SharePoint list in GCC. Getting errors with Concat in HtmlText. What's the correct approach?

 

 

I have the same question (0)
  • Suggested answer
    Sunil Kumar Pashikanti Profile Picture
    2,318 Moderator on at
     
    You don’t need Concat() for a single gallery row, and you don’t have to use HtmlText at all to draw a bar. The simplest, most reliable approach is to put a Rectangle inside the gallery template and drive its Width from your AwardDate.
     
    Insert a Rectangle control inside the gallery’s template.
    Set properties:
    // Rectangle.Width
    Max(
        0,
        RoundDown(
            DateDiff(
                Today(),
                // If AwardDate is a Date column, use ThisItem.AwardDate.
                // If it’s text, wrap with DateValue(ThisItem.AwardDate).
                ThisItem.AwardDate,
                Days
            ) / 2,
            0
        )
    )
    
    // Rectangle.Height
    8
    
    // Rectangle.X (optional offset)
    0
    
    // Rectangle.Fill (color)
    RGBA(0,120,212,1)
    
    // (Optional) Handle blanks:
    If(IsBlank(ThisItem.AwardDate), 0, /* the expression above */)
    
    Why this works
    No HtmlText or CSS, fewer parsing issues.
    DateDiff(Today(), ThisItem.AwardDate, Days) returns the day gap; / 2 maps days→pixels.
    Max(0, …) guards negative widths (e.g., future dates).
    If your SharePoint column is text, use DateValue(ThisItem.AwardDate); if it’s a Date column, use ThisItem.AwardDate directly.
     
     
    ✅ If this answer helped resolve your issue, please mark it as Accepted so it can help others with the same problem.
    👍 Feel free to Like the post if you found it useful.
     
     

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

Season of Sharing Community Challenge Launch!

Jump in, show your community spirit, and win prizes!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Congratulations to the May Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
Valantis Profile Picture

Valantis 424

#2
WarrenBelz Profile Picture

WarrenBelz 355 Most Valuable Professional

#3
11manish Profile Picture

11manish 290

Last 30 days Overall leaderboard