# Perspective Equipment Schedule + save data event

**URL:** <https://forum.inductiveautomation.com/t/perspective-equipment-schedule-save-data-event/64430>\
**Category:** Ignition\
**Tags:** scripting, perspective\
**Created:** [September 23, 2022, 4:37pm UTC](https://forum.inductiveautomation.com/t/perspective-equipment-schedule-save-data-event/64430 "2022-09-23T16:37:13Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![gerardopignatiello96](https://avatars.discourse-cdn.com/v4/letter/g/df788c/32.png) [@gerardopignatiello96](https://forum.inductiveautomation.com/u/gerardopignatiello96)\
**Post date:** [September 23, 2022, 4:37pm UTC](https://forum.inductiveautomation.com/t/perspective-equipment-schedule-save-data-event/64430/1 "2022-09-23T16:37:13Z")

</div>

Good evening,

I’m using the Perspective Equipment Schedule component, I noticed that once the event is created if I change session the event is lost.  
How can I solve it?  
Do I need to create a database? if you could show me an example ?

Thank you  
Gerardo

---

<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:** [September 23, 2022, 6:38pm UTC](https://forum.inductiveautomation.com/t/perspective-equipment-schedule-save-data-event/64430/2 "2022-09-23T18:38:27Z")

</div>

Hi @gerardopignatiello96, yes, if you want the schedule events to be persistent, you’d need to use a database, dataset tag, or some other structure.

You can start with the object that gets created when you add an event to the schedule by default to get a sample database table:

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

Something like

```sql
CREATE TABLE dbo.ScheduleEvent (
    ScheduleEventID INT PRIMARY KEY IDENTITY (1, 1),
    Label NVARCHAR (50) NOT NULL,
    StartDate DATETIME NOT NULL,
    EndDate DATETIME,
    LeadTime INT,
    PercentDone INT,
    BackgroundColor NVARCHAR(50)
);

```

This is a very barebones structure which won’t be very useful in a production setting, but it will work for this component.

Then, you can change the `on*Event` actions to use this table and insert the added event into the database table we created above instead of into the schedule’s `scheduleEvents` prop. Then on the `scheduledEvents` property, bind a query to select all of the events in your database table.

---

<div class="post-metadata">

**Author:** ![gerardopignatiello96](https://avatars.discourse-cdn.com/v4/letter/g/df788c/32.png) [@gerardopignatiello96](https://forum.inductiveautomation.com/u/gerardopignatiello96)\
**Post date:** [November 2, 2022, 10:56am UTC](https://forum.inductiveautomation.com/t/perspective-equipment-schedule-save-data-event/64430/3 "2022-11-02T10:56:35Z")

</div>

Thanks a lot
