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

Build a calendar view from date time fields present in a form ( using CDS datasource) to show that record as a calendar event

Hi,

 

i have a requirement to show a calendar view of my events that are actually my entity records with start and end times.

For eg. im assigning a task to a engineer on specified dates, so when that engineer logs into his powerapp he should be able to see a calendar view of all the tasks assigned to him on given dates. ( those tasks are actually my entity data)

Out of teh box calendar screen template is attached to O365 data source. using formula

 

SortByColumns(Filter(MyCalendarEvents, Text(Start, DateTimeFormat.ShortDate) = Text(_dateSelected, DateTimeFormat.ShortDate)), "Start")

 

If i try to replace "MyCalendarEvents" with my CDS datasource name and its respective field agianst "Start" it doesnt validate . gives error.


How can i achieve my requirement. Kindly assist

 

 

1 ACCEPTED SOLUTION

Accepted Solutions
Community Support Team
Community Support Team

Re: Build a calendar view from date time fields present in a form ( using CDS datasource) to show that record as a calendar event

Hi @Rkaur ,

Have you solved your problem?

 

Based on the needs that you mentioned, I think your direction is right. The Calendar Screen is a good choice for you.

 

Based on the formula you provided within the Items property of the CalendarEventsGallery1, I think there is something wrong with it. Please consider modify your formula as below:

SortByColumns(
Filter('Bookable Resource Bookings', Text('Start Time', DateTimeFormat.ShortDate) = Text(_dateSelected, DateTimeFormat.ShortDate)),
"Start Time"
)

For your second quesion, the Id property from the ThisItem.Id formula or the  _selectedCalendarEvent.Id formula represents the Id property of a Outlook Calendar event (the CalendarEventsGallery1 previously connects to your Office 365 data source).

As an fixed solution, please consider replace the Id property within the Primary Key column of your CDS Entity ('Bookable Resource Bookings'). I assume that the "prefix_bookableresourcebookingsid" column is the Unique Identifier column in your CDS Entity, you should modify the formula as below:

If(ThisItem.prefix_bookableresourcebookingsid = _selectedCalendarEvent.prefix_bookableresourcebookingsid, 2, 0)

Or

If(ThisItem.'Bookable Resource Bookings' = _selectedCalendarEvent.'Bookable Resource Bookings', 2, 0)

same operation for other same issue within your app.

 

Please consider take a try with above solution, then check if the issue is solved. If you have solved your problem, please go ahead to click "Accept as Solution" to identify this thread has been 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.
8 REPLIES 8
powerdiver
Level 8

Re: Build a calendar view from date time fields present in a form ( using CDS datasource) to show that record as a calendar event

@Rkaurcould you hover on top of the red 'x' (or go to the app checker) and provide us with the error message you get ? Also, maybe a copy of your CDS entity definition?

 

Rkaur
Level: Powered On

Re: Build a calendar view from date time fields present in a form ( using CDS datasource) to show that record as a calendar event

Hi,

 

So its a "bookable resource booking" entity which we use to assign and schedule resources for jobs.

 

attaching screen for error

invalid arguments etc..

 

powerdiver
Level 8

Re: Build a calendar view from date time fields present in a form ( using CDS datasource) to show that record as a calendar event

Without having the exact definition of your entity, my best guess is that you should change "Start" for "Start Time" as this is the name of the column you want to Sort on.

Rkaur
Level: Powered On

Re: Build a calendar view from date time fields present in a form ( using CDS datasource) to show that record as a calendar event

Hi, 

There are otherthings too that along with this calendar screen template as shown in my previosu screenshot. so even when i fix the Items property with actual datsource name and field name .. other areas such as rectangle border that refers to formula are invalidating.

If(ThisItem.id = _selectedCalendarEvent.Id, 2, 0)

 

what does "id" refer to here. what should i be pointing it to ?

Is property "_selectedCalendarEvent" still applicable even if my datasource is a CDS entity ? i doubt not coz it refer to by default o365 calendar. so what should i be replaicng here ?

 

Attching my entity definition screen with field info if this is what you you were loking for.

 

Rkaur
Level: Powered On

Re: Build a calendar view from date time fields present in a form ( using CDS datasource) to show that record as a calendar event

Well, i figured a way .. as of.

New to Powerapps so still struggling with its elements.

 

powerdiver
Level 8

Re: Build a calendar view from date time fields present in a form ( using CDS datasource) to show that record as a calendar event

that's excellent news ;-)

 

Maybe you'd want to share those results so we can all benefit from your learning experience ?

 

Community Support Team
Community Support Team

Re: Build a calendar view from date time fields present in a form ( using CDS datasource) to show that record as a calendar event

Hi @Rkaur ,

Have you solved your problem?

 

Based on the needs that you mentioned, I think your direction is right. The Calendar Screen is a good choice for you.

 

Based on the formula you provided within the Items property of the CalendarEventsGallery1, I think there is something wrong with it. Please consider modify your formula as below:

SortByColumns(
Filter('Bookable Resource Bookings', Text('Start Time', DateTimeFormat.ShortDate) = Text(_dateSelected, DateTimeFormat.ShortDate)),
"Start Time"
)

For your second quesion, the Id property from the ThisItem.Id formula or the  _selectedCalendarEvent.Id formula represents the Id property of a Outlook Calendar event (the CalendarEventsGallery1 previously connects to your Office 365 data source).

As an fixed solution, please consider replace the Id property within the Primary Key column of your CDS Entity ('Bookable Resource Bookings'). I assume that the "prefix_bookableresourcebookingsid" column is the Unique Identifier column in your CDS Entity, you should modify the formula as below:

If(ThisItem.prefix_bookableresourcebookingsid = _selectedCalendarEvent.prefix_bookableresourcebookingsid, 2, 0)

Or

If(ThisItem.'Bookable Resource Bookings' = _selectedCalendarEvent.'Bookable Resource Bookings', 2, 0)

same operation for other same issue within your app.

 

Please consider take a try with above solution, then check if the issue is solved. If you have solved your problem, please go ahead to click "Accept as Solution" to identify this thread has been 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.
Rkaur
Level: Powered On

Re: Build a calendar view from date time fields present in a form ( using CDS datasource) to show that record as a calendar event

Thankyou. i did exactly the same.

Helpful resources

Announcements
firstImage

Watch Sessions On Demand!

Continue your learning in our online communities.

Power Platform 2019 release wave 2 plan

Power Platform 2019 release wave 2 plan

Features releasing from October 2019 through March 2020

FirstImage

Power Platform World Tour

Coming to a city near you

thirdimage

PowerApps Community User Group Member Badge

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

FourthImage

Join PowerApps User Group!!

Connect, share, and learn with your peers year-round

SecondImage

Power Platform Summit North America

Register by September 5 to save $200

Users Online
Currently online: 195 members 4,783 guests
Please welcome our newest community members: