> 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/crm/crm-tutorial-videos/crm-updating-lead-custom-fields-with-the-loss-reason-token.md).

# CRM - Updating Lead Custom Fields with the Loss Reason Token

Automating updates in CRM systems is an essential practice for keeping records consistent and information organized. In this article, we present a step-by-step guide to implementing an automation that updates a custom field in a lead record using the "Loss Reason" token.

The goal is simple: whenever an opportunity is marked as "Lost", the system will automatically fill in the lead's custom field with the information corresponding to the loss reason.&#x20;

It is worth noting that the "Loss Reason" token is exclusive to CRM use, being triggered by an action directly related to the opportunity flow.

This integration ensures greater data accuracy, makes future analyses of loss reasons easier, and contributes to more effective sales and customer relationship strategies. Follow the step-by-step guide to implement this functionality.<br>

{% embed url="<https://youtu.be/M8tC5M60ys4>" %}


---

# 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/crm/crm-tutorial-videos/crm-updating-lead-custom-fields-with-the-loss-reason-token.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.
