cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
akmiecik1
Level: Powered On

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
Community Support Team
Community Support Team

Re: Powerapps Calendar Screen: Highlight dates based on Collection

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

4 REPLIES 4
Community Support Team
Community Support Team

Re: Powerapps Calendar Screen: Highlight dates based on Collection

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

akmiecik1
Level: Powered On

Re: Powerapps Calendar Screen: Highlight dates based on Collection

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.

akmiecik1
Level: Powered On

Re: Powerapps Calendar Screen: Highlight dates based on Collection

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
)
akmiecik1
Level: Powered On

Re: Powerapps Calendar Screen: Highlight dates based on Collection

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
)

 

 

 

 

 

Helpful resources

Announcements
thirdimage

Power Apps Super User Class of 2020

Check it out!

thirdimage

Power Apps Community User Group Member Badge

Fill out a quick form to claim your user group badge now!

sixthImage

Power Platform World Tour

Find out where you can attend!

Power Platform 2019 release wave 2 plan

Power Platform 2019 release wave 2 plan

Features releasing from October 2019 through March 2020

SecondImage

Difinity Conference

The largest Power BI, Power Platform, and Data conference in New Zealand

Top Solution Authors
Top Kudoed Authors (Last 30 Days)
Users online (3,902)