cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
akmiecik1
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
v-xida-msft
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
v-xida-msft
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

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.

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
)

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
)

 

 

 

 

 

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
UG GA Amplification 768x460.png

Launching new user group features

Learn how to create your own user groups today!

Community Connections 768x460.jpg

Community & How To Videos

Check out the new Power Platform Community Connections gallery!

M365 768x460.jpg

Microsoft 365 Collaboration Conference | December 7–9, 2021

Join us, in-person, December 7–9 in Las Vegas, for the largest gathering of the Microsoft community in the world.

Top Solution Authors
Top Kudoed Authors
Users online (2,304)