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 / Gallery control color ...
Power Apps
Unanswered

Gallery control color change on the basis of set conditions without Power Automate

(0) ShareShare
ReportReport
Posted on by 321

I have one table with following fields:

  1. Name: Text type
  2. Number of Years: Whole Number type
  3. Reoccurrence: Combobox ( Yearly, Quarterly, Monthly)
  4. Date: Date only type

I am asking users to select different options as per their role when filling out one form which is connected to this table. 

For example:

One user selected:

Name - John

Number of Years - 3

Reoccurrence - Yearly

Date: 01-Jul-22

One Gallery which is connected to this table has one extra label of which color will change as per below requirements.

I want every year ( as per "Reoccurrence" selection), 7 days before one year completes the status of Color label changes to Red and then turns green after one year completion. This should repeat every year till 3 years( as per "number of years" ) completes.

Is there any way we can do this without using Power Automate?

 

Categories:
  • MVP-Phipps Profile Picture
    3,526 Super User 2024 Season 1 on at

    I would suggest setting a variable and adding the logic to the variable. Therefore the color of the label is then set to variable name and you set the variable on the on app start. Do you need help with the formula? If so what the '7 days before one year completes the status'  component/column called in order to calculate a year before etc...

    Please Accept as Solution if it solves your question. Or just give it a Thumbs Up if it is helpful as can help others.

    LinkedIn: https://www.linkedin.com/in/charlie-phipps-%F0%9F%91%A8%E2%80%8D%F0%9F%92%BB-91338715b/
    Subscribe to my YouTube: https://www.youtube.com/channel/UChmFBGU1YKIU91sNMQ7buGg
    Twitter: https://twitter.com/phipps0218

     

  • Ondrix Profile Picture
    102 on at

    Hello  sure it is possible.

    For gallery colors i would use html text box, with little knowledge you can make pretty galleries. 

     

    I dont know if Date is current date or date when was entry created, but to determine lenght of 3 years i would patch to that table also when was entry created(if Date doesnt represent that) and compare it in if statement.
    And for 7 days before ending of year since december has always 31 days i would use:

    'Date(Year(Now());12;31)' - for determining of end of this year.

    'Date(Year(Now());Month(Now());Day(Now()))' - for determining today date

     

    And these two dates i would compare in if() statement.

     

    I use european powerapps so replace ";" with ",".

     

    If you need detailed explanation just ask.

     

  • ashokpershad Profile Picture
    321 on at

    @Ondrix @phipps0218 

    Thanks for your reply.

    Your solution is resolving first part but how to do same thing every year for let say 3 years as per Reoccurrence column selection? How it will understand that one year completes and now same thing need ot be done for 2nd year...3rd year... etc. I think it require some kind of WHILE LOOP which PowerApps doesn't support 😞

    Also the date should not be end of year but it should start from the date as selected by user example 01-Jul-2022 and end exactly one year after this date. 

  • Ondrix Profile Picture
    102 on at

    @ashokpershad 

    If you want a while loop you can fake it like this: 

    https://www.youtube.com/watch?v=jQtRdvpF9F0


    This code gives me back 365 number as result.

    Ondrix_0-1658398421701.png
    So substituing first part with your date +1 year will give you how much days its until your year ends and you can use it in if statement.

     

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 Winners!

Congratulations to our community stars!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Leaderboard > Power Apps

#1
11manish Profile Picture

11manish 248 Super User 2026 Season 2

#2
WarrenBelz Profile Picture

WarrenBelz 192 Most Valuable Professional

#3
Mohsin Ali Profile Picture

Mohsin Ali 135

Last 30 days Overall leaderboard