cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
Helper I
Helper I

Powerapps Calendar Screen: Highlight dates based on Collection

I have a Collection of dates defined by:

 

Collect(_mydates,ForAll(Table1,DateValue(Text(Date,DateTimeFormat.ShortDate))));

 

(creates list of dates from Date column in Table1)

 

And I am using  Calendar Gallery modified from Calendar Screen in Powerapps and David Nissimoff's blog entry:  Building an interactive calendar view with PowerApps

 

I have added a Circle to the MonthDayGallery of the calendar and would like to make the circle visible for every date that shows up in the Collection using the Visible parameter of the circle along with the Fill parameter.

 

Thanks in advance for any ideas?

 

Additional Notes:

  • The above Collect command does a good job of eliminating the time from the date (thank you 
  • The above request is very similar to the last comment on the above mentioned blog.  Basically, how to replace _holidays with a list of variable dates from an Excel table.
  • Look both ways before crossing the street.  It's good advice and we just don't hear it enough.

 

 

 

1 ACCEPTED SOLUTION

Accepted Solutions
Highlighted
Community Support
Community Support

Hi @akmiecik1 ,

Could you please share a bit more about your scenario?

Do you want to highlight the dates listed in your Collection within your Calendar Gallery?

 

I have made a test on my side, please consider take a try with the following workaround:

1. Add a Calendar screen within your app.

2. Set the Visible property of the Subcircle1 within the MonthDayGallery1 to following:

If(
(DateAdd(_firstDayInView, ThisItem.Value) = _dateSelected || DateAdd(_firstDayInView, ThisItem.Value) in _mydates) && Title2.Visible,
true,
false
)

3.JPG

Note: The _mydates represents your dates collection in your app.

 

Please consider take a try with above solution, then check if the issue is solved.

 

Best regards,

Community Support Team _ Kris Dai
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

5 REPLIES 5
Highlighted
Community Support
Community Support

Hi @akmiecik1 ,

Could you please share a bit more about your scenario?

Do you want to highlight the dates listed in your Collection within your Calendar Gallery?

 

I have made a test on my side, please consider take a try with the following workaround:

1. Add a Calendar screen within your app.

2. Set the Visible property of the Subcircle1 within the MonthDayGallery1 to following:

If(
(DateAdd(_firstDayInView, ThisItem.Value) = _dateSelected || DateAdd(_firstDayInView, ThisItem.Value) in _mydates) && Title2.Visible,
true,
false
)

3.JPG

Note: The _mydates represents your dates collection in your app.

 

Please consider take a try with above solution, then check if the issue is solved.

 

Best regards,

Community Support Team _ Kris Dai
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

Highlighted

Kris,  Thank you so much.  

 

I modified your answer to include two circle with the Visible for today's circle set to:

And(DateAdd(_firstDayInView, ThisItem.Value) = _dateSelected)

(that's the default value that comes with Calendar Screen)

 

and the Visible for the circles to show _mydates set to (the mydates_circle):

If(
    (DateAdd(_firstDayInView, ThisItem.Value) in _mydates)  && Title2.Visible, 
    true, 
    false
)

 

Then I got to thinking.  What if:

 

I added to the Collection of _mydates another column called EventType with two options (A and B)

What would it take to make the Circle for A red, and the Circle for B green.

 

Adding the column to the collection of my dates creates an error in the mydates_circle.Visible:  invalid schema, expected on column table

 

Trying to work it from there.

Highlighted

Another approach:

 

Modify the Visible statement from the circle to looks directly at the excel table.

 

This example does not work but may help for people to understand:

If(
    (DateAdd(_firstDayInView, ThisItem.Value) in Table1.mydates)  && Title2.Visible, 
    true, 
    false
)
Highlighted

In the above example of bad code, 

Table1.mydates

needs to be replace with,

ForAll(Table1,DateValue(Text(Date,DateTimeFormat.ShortDate)))

Resulting in a Visible statement for the circle that looks like:

 

if(
    (DateAdd(_firstDayInView, ThisItem.Value) in ForAll(Table1,DateValue(Text(Date,DateTimeFormat.ShortDate))))  && Title2.Visible, 
    true, 
    false
)

 

 

 

 

 

Highlighted

Hi akmiecik1!
Could you achieve the EventType column in your App? ...circle A red, circle B green...
It is possible to highlight the circles in a range of dates, you know a start date and end date?
Thanks in advance.

Helpful resources

Announcements
Community Conference

Power Platform Community Conference

Check out the on demand sessions that are available now!

News & Announcements

Community Blog

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

secondImage

Power Platform 2020 release wave 2 plan

Features releasing from October 2020 through March 2021

Community Highlights

Community Highlights

Check out the Power Platform Community Highlights

Top Solution Authors
Top Kudoed Authors
Users online (9,735)