> For the complete documentation index, see [llms.txt](https://docs.sprinthub.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.sprinthub.com/en/topics/general/sac-360/sac-360o-automations/sac-360o-automation-saving-the-date-of-the-last-service.md).

# SAC 360º Automation - Saving the Date of the Last Service

## Creating a Custom Field

In this example, a **custom field** to store the **date of the last contact**.\
This field will be used later to identify **idle leads** — that is, those who have not been in contact for a significant period — allowing better control over the **lead limit over time**.

<figure><img src="https://684109703-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F9FzUKkagBNy5uQ7AtGNa%2Fuploads%2FwWxtCPfmIvmOc8nft2bU%2Fimage.png?alt=media&amp;token=573e7bb7-8b30-4a70-9385-f12dfe086309" alt=""><figcaption><p>Custom Fields (Lead).</p></figcaption></figure>

<figure><img src="https://684109703-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F9FzUKkagBNy5uQ7AtGNa%2Fuploads%2F4YLzU4wHp2w9qpdjZPoL%2Fimage.png?alt=media&amp;token=bd07931a-1296-4cae-8caa-cc0c026d5f8c" alt=""><figcaption><p><em>Creating a Date-type field.</em></p></figcaption></figure>

## Setting Up Automation

The automation must contain the following minimum settings:

1. A title, which will be displayed in the automation list.
2. The action **Update lead data**, with the token `{function=today}`, to record the current day in the lead field.
3. Limit automation execution to contacts with the status **Completed**.

Then just save the automation, and start it for the already open contacts.

<figure><img src="https://684109703-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F9FzUKkagBNy5uQ7AtGNa%2Fuploads%2FaX9E03KF5UlKWC3HcNx9%2Fimage.png?alt=media&amp;token=12180209-26c7-4172-8f1c-056103f30455" alt=""><figcaption><p><em>360º Customer Service Automation.</em></p></figcaption></figure>

<figure><img src="https://684109703-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F9FzUKkagBNy5uQ7AtGNa%2Fuploads%2FcVE4EmxP7WNAk3kMC6WX%2Fimage.png?alt=media&amp;token=0c1356e3-e390-4440-9040-3c4ea5f118e4" alt=""><figcaption><p><em>Action <strong>Update lead data</strong>.</em></p></figcaption></figure>

<figure><img src="https://684109703-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F9FzUKkagBNy5uQ7AtGNa%2Fuploads%2FfSELXkmohThf3BN1QAX6%2Fimage.png?alt=media&amp;token=babeb5e7-5cad-4e4d-8302-35265795f49e" alt=""><figcaption><p><em>Limit to the statuses.</em></p></figcaption></figure>

## Filtering leads that haven't been contacted for months

To filter all leads in the database that **haven't been contacted for more than X days** (or **for less than X days**), it is necessary to create a **segment with a filter**.\
When a segment has filters, it becomes **dynamic** — that is, all leads that meet the defined conditions will be **automatically included** in this segment. For this example, the condition **'The value of the lead field...'**.

This allows, in the future, the creation of **automations** from this group of leads, such as a **mass deletion** or the application of **follow-up strategies**.

<figure><img src="https://684109703-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F9FzUKkagBNy5uQ7AtGNa%2Fuploads%2Fcd8bZPulIsy3wBTTbhHU%2Fimage.png?alt=media&amp;token=4ace13b6-ddcc-4493-bbc8-49f84e1baf5c" alt=""><figcaption><p><em>Defining the segment name.</em></p></figcaption></figure>

<figure><img src="https://684109703-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F9FzUKkagBNy5uQ7AtGNa%2Fuploads%2FbCq9X11RGT2oUdtRa8Ii%2Fimage.png?alt=media&amp;token=2b331504-13bb-4648-a0a2-ad62ae070000" alt=""><figcaption><p><em>Filter Conditions.</em></p></figcaption></figure>


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://docs.sprinthub.com/en/topics/general/sac-360/sac-360o-automations/sac-360o-automation-saving-the-date-of-the-last-service.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
