# Creating and Updating Instance

## Creating Instance

{% hint style="success" %} <mark style="color:green;">Prerequisite:</mark> Please make sure that the ***Data Store Settings*** has been configured from the ***Admin module*** to **access the Instance functionality** for the Data Store inside a ***Story.***
{% endhint %}

{% hint style="success" %}
Check out the given walk-through on how to access the Create Instance icon and creating an instance using the Story module.
{% endhint %}

![Accessing the Create Instance icon and creating an instance for a new Story](https://972575688-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FRYq1HgffNfbnIMWPu1D5%2Fuploads%2FevdRWdJ7N1cePCr90reh%2FdesignviewThroughInstance.gif?alt=media\&token=09f0ee96-dbf5-4860-9d26-ed4c68312c64)

The ***Create Instance*** icon is used to load the data for the first time from the datastore into Elastic or MongoDB server as the configuration done in the ***Admin Module*** for Datastore Settings. The ***Time to Live*** for the data will be of 1-30 days.

* Navigate to the Data Store list inside a new Story.
* Select a Data Store from the list.
* Click the ***Create Instance*** icon for the selected Data Store.

&#x20;   &#x20;

![Accessing the Create Instance icon for a Data Store within a Story framework](https://972575688-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FRYq1HgffNfbnIMWPu1D5%2Fuploads%2FOBadC0S7HhqSpMDeMSCp%2Fimage.png?alt=media\&token=99e86182-8e2e-4b5f-b292-bd2a18abbb48)

* The ***Data Store instance*** page opens the selected Data Store.
* Provide the ***Time to Live*** value in days. The maximum set Time to Live limit is 30 days.
* Click the ***Refresh*** option.
* A confirmation message appears and the Instance gets created for the selected Data Store.

&#x20;   &#x20;

![Setting the Time to Live (TTL) for a Data Store](https://972575688-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FRYq1HgffNfbnIMWPu1D5%2Fuploads%2Fj50T285R8n9jE4gizWpn%2Fimage.png?alt=media\&token=eff5b290-eb3e-4f18-933a-6d0dd8435a4e)

* Navigate back to the ***Data Store*** from the displayed list under a Story.
* The ***Create Instance*** icon gets converted into the ***Update Instance***.

&#x20;   &#x20;

![The Update Instance icon for a Data Store within a Story framework ](https://972575688-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FRYq1HgffNfbnIMWPu1D5%2Fuploads%2Fx8iAphkifnUYoinmci7K%2Fimage.png?alt=media\&token=5d5a5998-94ce-48a6-8f5f-d75945ef83e7)

#### Updating Instance

The permitted ***Time to Live*** limit for a Data Store is only 30 days (maximum). If it goes above that, data will not be there in the Story. Hence, the user can manually update the instance by clicking the ***Update Instance*** icon so the data will be refreshed again in the ***ES*** or ***MongoDB***.
