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

## Creating Custom Field

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

<figure><img src="/files/e55a9539082dc28de01e2942275e643459de27c7" alt=""><figcaption><p>Custom Fields (Lead).</p></figcaption></figure>

<figure><img src="/files/161433d6721a2ec5c3d5398ff0d9dde4ee85b326" alt=""><figcaption><p><em>Creating a Date type field.</em></p></figcaption></figure>

## Configuring 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's field.
3. Limit the automation execution to services with the status **Completed**.

Then, just save the automation, and start it for the services already opened.

<figure><img src="/files/7a8f541a0783a88bafcbc89746c4b2b32d4a96f9" alt=""><figcaption><p><em>360º Customer Service Automation.</em></p></figcaption></figure>

<figure><img src="/files/57b0858a867041aec58581363c159f9dc5897cc9" alt=""><figcaption><p><em>Action <strong>Update lead data</strong>.</em></p></figcaption></figure>

<figure><img src="/files/e0ac65e5425acfe08d0f72564e441dad0e6608b6" alt=""><figcaption><p><em>Limit to the statuses.</em></p></figcaption></figure>

## Filtering leads who haven't contacted in months

To filter all leads in the database who **have not made contact for more than X days** (or **have made contact less than X days ago**), it is necessary to create a **segment with filter**.\
When a segment has filters, it becomes **dynamic** — that is, all leads that meet the defined conditions will be **automatically included** in that 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="/files/65d3b71a1b05b465f5685e10c75eae08609ef625" alt=""><figcaption><p><em>Defining the segment name.</em></p></figcaption></figure>

<figure><img src="/files/b0e19eea6bb7ebd50d7ddf9f4d113eb11708aa24" alt=""><figcaption><p><em>Filter Conditions.</em></p></figcaption></figure>


---

# Agent Instructions: 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:

```
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>
```

The question should be specific, self-contained, and written in natural language.
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.
