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 / conditional fill color...
Power Apps
Answered

conditional fill coloring formatting in gallery for iOS not working

(0) ShareShare
ReportReport
Posted on by 202

I have a gallery that has a date field from a SQL data source that I want to have a conditional fill color applied based on the date being equal to a selected date on the main screen.  This works fine in development mode and run mode in Windows.  When I open the app in an iPad or iPhone, the fill for all date fields is black.  Here is the logic to pick color:

 

If(IsBlank(ThisItem.Stock_Date), White, // This checks to give default color if no date value
// if there is a date value, test if the gallery field date is equal to selected date
      If(DateValue(Text(ThisItem.Stock_Date,"[$-en-US]yyyy//mm//dd"))

       =

        DateValue(Text(DatePicker1.SelectedDate,"[$-en-US]yyyy//mm//dd"))  ,
                     Yellow, // if dates are equal, Fill will be Yellow
                      White) // if dates are not equal, Fill will be White
   )

Example from Windows run shows below as I want it with yellow fill for date when 08/05 is selected from date picker control on main screen.

But on iPad, fill will be black for all date fields in gallery.

Any help?

lknudson1_0-1628631679395.png

 

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

    @lknudson1 

    Please consider changing your Formula to the following:

    If(IsBlank(ThisItem.Stock_Date), White, 
     ThisItem.Stock_Date = DatePicker1.SelectedDate, Yellow,
     White
    )

    See if that works better for you.

     

    I hope this is helpful for you.

  • Verified answer
    lknudson1 Profile Picture
    202 on at

    Well, I got it to work with what's below.  Not sure why iOS was so fussy.

     

    If(!IsBlank(ThisItem.Stock_Date),
    If(
    DateValue(ThisItem.Stock_Date)
    =
    DatePicker1.SelectedDate,
    Yellow, White),
    White)

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

    @lknudson1 

    So you're stating that the Stock_Date column in your list is a text column.  If so, then yes, this is key to remember that the PowerApps designer is very forgiving of type conversions (numbers to text, text to numbers, dates to text, etc).  However, the Play Apps on the mobile devices are NOT forgiving.  If they have any type conversion problems, they will just error out in the formula and in your case you would get a blank result for your color...which is black.

    This is one of the main causes of "my app works fine in design mode, but when I play it on the app, it does not work - why?"

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

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Users!

Kudos to our 2025 Community Spotlight Honorees

Congratulations to our 2025 community superstars!

Leaderboard > Power Apps

#1
Haque Profile Picture

Haque 85

#2
WarrenBelz Profile Picture

WarrenBelz 76 Most Valuable Professional

#3
Kalathiya Profile Picture

Kalathiya 38 Super User 2026 Season 1

Last 30 days Overall leaderboard