> For the complete documentation index, see [llms.txt](https://help.iviva.com/lucy/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://help.iviva.com/lucy/my-work-folders/user-interfaces/saving-a-widget-as-a-template.md).

# Saving a Widget as a Template

You can save an existing user-created widget as a  Widget Template and reuse it to create new widgets.&#x20;

### Prerequisites

It is assumed that you have the basic knowledge on creating Folders and Widgets in Lucy.

Find the article here to create a new folder.

{% content-ref url="/pages/UONM0W1YQZYAEaIXnFV0" %}
[Creating a New Folder](/lucy/my-work-folders/creating-a-new-folder.md)
{% endcontent-ref %}

For an example, if you want to create a widget similar to an existing one but with a different data source,  save the current widget as a template, then use it to build the new widget.

e.g., Consider a bar chart widget that displays the count of IT assets categorised by asset category. You can save this widget as a template. Then, create a new bar chart widget based on the template and link it to a different data source.

In this article, we'll use an existing bar chart widget and save it as a template. Then use that template to create another bar chart by selecting a different data source.

### Creating a User Interface

Find the article on how you can create a bar chart widget to visualise information.

[Visualising Data by Selecting a Data source](https://help.iviva.com/lucy/my-work-folders/user-interfaces/pages/pqI2BARVQwSBsMi5HRga#id-1.-visualising-data-by-selecting-a-data-source)

<figure><img src="https://333252015-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FTG5DCdGHEfzVksM49xh8%2Fuploads%2Fx0qfZKlafZ3TJsxMr1j9%2Fimage.png?alt=media&amp;token=ac8a9d60-ef8d-4591-bc91-a985948915d4" alt=""><figcaption><p>Example of a Widget</p></figcaption></figure>

For more insights on designing a user interface, find the article here.

{% content-ref url="/pages/zSOk0YQeh1lr65K1RjgQ" %}
[Designing a User Interface](/lucy/my-work-folders/user-interfaces/designing-a-user-interface.md)
{% endcontent-ref %}

### Saving a Widget as a Template

Below are the steps to save an existing widget as a template.

1. On the app homepage, go to the **My Work** tab.
2. Search and click on the desired folder to open it.
3. Go to the **User Interfaces** tab.
4. Search and select the required user interface. Then mouse hover over it and click the **Edit** icon that displays.
5. Click the three dots ![](https://333252015-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FTG5DCdGHEfzVksM49xh8%2Fuploads%2FsYHV3iDy84Zn1fdjhAEY%2Fimage.png?alt=media\&token=d9309222-638d-411e-9703-7d4f57081943)on the top right.
6. Click the **Save widget as a template** button.
7. **Template Name**: Enter a unique template name.
8. Template Description: Enter a short detail related to the template.
9. Click **Save**.
10. Now, the widget will be listed under the "My Templates" tab in the "Select a Template" window.

<figure><img src="https://333252015-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FTG5DCdGHEfzVksM49xh8%2Fuploads%2Ft8L25H8qJqsRkYPfKMrC%2Fimage.png?alt=media&amp;token=368f3a70-e739-4a1b-8d0a-4d27104e4923" alt=""><figcaption><p>Saving the widget as a Template</p></figcaption></figure>

### Accessing and Reusing Your Saved Widget Templates

Now, whenever you need to create a new widget similar to one you've already designed, you can easily use a saved widget template. Any type of widget you've created, such as a Form, Simple Card, Radial Gauge, can be saved as a template for future use.

All your saved templates can be accessed from the "My Templates" tab in the "Select a Template" window.

<figure><img src="https://333252015-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FTG5DCdGHEfzVksM49xh8%2Fuploads%2FptnaUwQi17ta3YBG3mHc%2FSelect%20a%20Template%20window.png?alt=media&amp;token=f0c5f0ee-431c-4c7e-8911-820bf24214f6" alt=""><figcaption><p>Select a Template Window</p></figcaption></figure>

#### Utilise a Saved Widget Template to Create a New Widget

To create a new widget, we can leverage a saved template, customise it to suit our needs, and connect it to a different data source. You can create unlimited number of customised widgets using a saved template.

1. On the app homepage, go to the **My Work** tab.
2. Search and click on the folder you wish to open.
3. Go to the **User Interfaces** tab.
4. Click the **Plus** icon.
5. Click **Start from Scratch** option.
6. Go to the **My Templates** tab in the Select a Template window.
7. Saved templates will be listed.
8. Find the template and click on it.
9. &#x20;Click **Edit this Template.**
10. The selected widget template will open on the widget designer page.
11. Customise the widget as necessary.
12. Click on the bar chart to launch its properties panel.
13. Under Source section, click on the linked database.
14. Bind a different data source.
    1. Click the ![](https://333252015-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FTG5DCdGHEfzVksM49xh8%2Fuploads%2F1oYDjfx48FuKnfUsUKuH%2Fimage.png?alt=media\&token=a73efb2e-794c-46a0-bc61-ed80ec45029b) icon to select a different data source. You can select a lucy action or a database.
    2. After selecting and preparing the data source, click Looks Good.
15. Customise the widget as necessary.
16. Under General tab, provide a name for the widget.
17. Click **Save Widget** to save the customisations.
18. Click the **Share** button. Then click **Open Page** to open your widget in a new window.

<figure><img src="https://333252015-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FTG5DCdGHEfzVksM49xh8%2Fuploads%2FHXPl4pQ2DrtP5X3zFs1F%2Fimage.png?alt=media&amp;token=afc27837-6a4d-448c-8204-952a2f1cc74a" alt=""><figcaption><p>A widget designed using the saved template</p></figcaption></figure>
