# Equipment schedule not displaying scheduled events

**URL:** <https://forum.inductiveautomation.com/t/equipment-schedule-not-displaying-scheduled-events/84999>\
**Category:** General Discussion\
**Tags:** perspective\
**Created:** [January 31, 2024, 6:25am UTC](https://forum.inductiveautomation.com/t/equipment-schedule-not-displaying-scheduled-events/84999 "2024-01-31T06:25:24Z")\
**Posts on this page:** 13\
**Page:** 1

<div class="post-metadata">

**Author:** ![jrd](https://avatars.discourse-cdn.com/v4/letter/j/b9bd4f/32.png) [@jrd](https://forum.inductiveautomation.com/u/jrd)\
**Post date:** [January 31, 2024, 6:25am UTC](https://forum.inductiveautomation.com/t/equipment-schedule-not-displaying-scheduled-events/84999/1 "2024-01-31T06:25:24Z")

</div>

Hi  
I am having a problem displaying scheduled events on a Perspective Equipment Schedule component. Events do not appear on the component  
Items are populated via polling from database with named query . The query returns Json format and has a transform to filter only the items I want displayed. The transform is:

```auto
	lst = [i for i in value if i['displayed'] == 1]
	return lst

```

and query is:

```auto
SELECT itemId , label, displayed
FROM gantt_resources 
WHERE site = :site 
AND scenario = :scenario

```

The scheduled events are also populated via polling database with named query, also in Json format. Query is:

```auto
SELECT 
  gantt_scheduled_events.itemId ,
  gantt_scheduled_events.eventId ,
  gantt_scheduled_events.startDate,
  gantt_scheduled_events.endDate,
  gantt_scheduled_events.label
,
  gantt_scheduled_events.backgroundColor
FROM gantt_scheduled_events

WHERE site = :site 
AND scenario = :scenario 

```

Can anyone shed some light on why the events do not appear?

Thanks

---

<div class="post-metadata">

**Author:** ![YF129701](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/yf129701/32/60498_2.png) [@YF129701](https://forum.inductiveautomation.com/u/YF129701)\
**Post date:** [January 31, 2024, 3:56pm UTC](https://forum.inductiveautomation.com/t/equipment-schedule-not-displaying-scheduled-events/84999/2 "2024-01-31T15:56:31Z")

</div>

What format are the `startDate` and `endDate` variables? If you add a database event manually (i.e. disable the polling binding and just add an object to `scheduledEvents`) does it show up in the schedule? Also, are your `itemID`s from your events query matching an of the `itemId`s in your items query?

Those are the most common things I've seen before, especially the date formats. I would drag on a new Equipment Schedule component into a view somewhere and look how the `scheduleEvents` objects are formatted and just copy that.

---

<div class="post-metadata">

**Author:** ![jrd](https://avatars.discourse-cdn.com/v4/letter/j/b9bd4f/32.png) [@jrd](https://forum.inductiveautomation.com/u/jrd)\
**Post date:** [January 31, 2024, 10:43pm UTC](https://forum.inductiveautomation.com/t/equipment-schedule-not-displaying-scheduled-events/84999/3 "2024-01-31T22:43:05Z")

</div>

Thanks for the reply  
I disabled polling and manually entered times. This didn't change things  
I have checked itemId's etc, Below is a screen shot

 ![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/c/4/c4e0b1d13b16303dd3e6bbe7d5bb785e154f5d49.png)

---

<div class="post-metadata">

**Author:** ![YF129701](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/yf129701/32/60498_2.png) [@YF129701](https://forum.inductiveautomation.com/u/YF129701)\
**Post date:** [January 31, 2024, 11:06pm UTC](https://forum.inductiveautomation.com/t/equipment-schedule-not-displaying-scheduled-events/84999/4 "2024-01-31T23:06:48Z")

</div>

Not sure if this is an issue, but the docs have the `eventID` with a capital D.

 ![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/e/3/e3336312e8aee0b1b09eee8b085b74b5409aea09.png)

---

<div class="post-metadata">

**Author:** ![jrd](https://avatars.discourse-cdn.com/v4/letter/j/b9bd4f/32.png) [@jrd](https://forum.inductiveautomation.com/u/jrd)\
**Post date:** [January 31, 2024, 11:30pm UTC](https://forum.inductiveautomation.com/t/equipment-schedule-not-displaying-scheduled-events/84999/5 "2024-01-31T23:30:44Z")

</div>

Thanks, I have tried that

---

<div class="post-metadata">

**Author:** ![YF129701](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/yf129701/32/60498_2.png) [@YF129701](https://forum.inductiveautomation.com/u/YF129701)\
**Post date:** [January 31, 2024, 11:56pm UTC](https://forum.inductiveautomation.com/t/equipment-schedule-not-displaying-scheduled-events/84999/6 "2024-01-31T23:56:16Z")

</div>

Can you try renaming `itemId` to `id` in the `items` list? I have an almost identical setup and it displays for me, but I believe the key should be called `id` and not `itemId` (in the `items` list - in the `scheduledItems` list, they need to be called `itemId`, confusingly)

**EDIT: added image**

 ![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/5/4/54c2110b51ea5696cf24828d2f81eaad8545c857.png)

---

<div class="post-metadata">

**Author:** ![jrd](https://avatars.discourse-cdn.com/v4/letter/j/b9bd4f/32.png) [@jrd](https://forum.inductiveautomation.com/u/jrd)\
**Post date:** [February 1, 2024, 12:33am UTC](https://forum.inductiveautomation.com/t/equipment-schedule-not-displaying-scheduled-events/84999/7 "2024-02-01T00:33:31Z")

</div>

I have started with clean sheet, still no joy  
Clearly I am missing something

 ![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/7/5/755833e6cfef6018e16b5124bfe529c2d14ba99b.png)

---

<div class="post-metadata">

**Author:** ![YF129701](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/yf129701/32/60498_2.png) [@YF129701](https://forum.inductiveautomation.com/u/YF129701)\
**Post date:** [February 1, 2024, 12:40am UTC](https://forum.inductiveautomation.com/t/equipment-schedule-not-displaying-scheduled-events/84999/8 "2024-02-01T00:40:09Z")

</div>

One last thing I noticed in your screenshots: the `eventID` should be `eventId` (the docs are wrong). That's the last thing I'll have you try because in my testing just now, it didn't show events with `eventID`. 🤞

---

<div class="post-metadata">

**Author:** ![jrd](https://avatars.discourse-cdn.com/v4/letter/j/b9bd4f/32.png) [@jrd](https://forum.inductiveautomation.com/u/jrd)\
**Post date:** [February 1, 2024, 1:40am UTC](https://forum.inductiveautomation.com/t/equipment-schedule-not-displaying-scheduled-events/84999/9 "2024-02-01T01:40:04Z")

</div>

I'm pretty sure the issue is with time format  
Here is a new component with event created "manually" in the Designer

 ![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/0/d/0d200327d6e8b2e615c954e8af7e5d82553dc545.png)  
And here is the event retrieved from database  
 ![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/a/4/a4232f11f835aefafc34871e09f1a6c4b896e330.png)

My understanding is that the startDate etc should be in millis? Is that correct?  
I have stored these in mySql in DATETIME formatted columns, and it does appear to return millis.  
But there is an obvious difference.

How should the be stored. retrieved etc?

---

<div class="post-metadata">

**Author:** ![YF129701](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/yf129701/32/60498_2.png) [@YF129701](https://forum.inductiveautomation.com/u/YF129701)\
**Post date:** [February 1, 2024, 2:23am UTC](https://forum.inductiveautomation.com/t/equipment-schedule-not-displaying-scheduled-events/84999/10 "2024-02-01T02:23:12Z")

</div>

That date format should work... as I said above, at least one problem you're having is that it should indeed be called `eventId` (note the capitalization) in `scheduledEvents`

 ![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/c/0/c08b48874e45d408125cd7894b1c748c92ef2941.png)

Misspelled as `eventID`:

 ![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/d/1/d10d6de979ebb8ceb0b1500999a3c3f7e7f3a0d3.png)

The fact that it's coming from the database should not affect anything... I had a years worth of orders in the component and they showed up fine once I figured out the formatting...

---

<div class="post-metadata">

**Author:** ![jrd](https://avatars.discourse-cdn.com/v4/letter/j/b9bd4f/32.png) [@jrd](https://forum.inductiveautomation.com/u/jrd)\
**Post date:** [February 1, 2024, 3:01am UTC](https://forum.inductiveautomation.com/t/equipment-schedule-not-displaying-scheduled-events/84999/11 "2024-02-01T03:01:45Z")

</div>

That's it. Thank you  
I had it correctly capitalised in the database, but the query was incorrect capitalisation....

Thanks again

---

<div class="post-metadata">

**Author:** ![YF129701](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/yf129701/32/60498_2.png) [@YF129701](https://forum.inductiveautomation.com/u/YF129701)\
**Post date:** [February 1, 2024, 3:38am UTC](https://forum.inductiveautomation.com/t/equipment-schedule-not-displaying-scheduled-events/84999/12 "2024-02-01T03:38:57Z")

</div>

Phew glad that was it as I was all out of ideas! If you can, mark the post as complete so that it displays on the forums homepage with this checkbox icon:  
 ![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/0/b/0bc8236c4d3e603557d9e552660bbc6dfa937fee.png)

(it helps to decide which posts to click on)

---

<div class="post-metadata">

**Author:** ![jrd](https://avatars.discourse-cdn.com/v4/letter/j/b9bd4f/32.png) [@jrd](https://forum.inductiveautomation.com/u/jrd)\
**Post date:** [February 1, 2024, 4:09am UTC](https://forum.inductiveautomation.com/t/equipment-schedule-not-displaying-scheduled-events/84999/13 "2024-02-01T04:09:33Z")

</div>

Thanks ! !
