> ## Documentation Index
> Fetch the complete documentation index at: https://help.treble.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Advanced settings

> What can be customized when a field has to be filled in at the exact moment the record is created, and what limits that customization has today.

This page explains the tool that solves the hardest problem of the integration: **the fields Salesforce requires at the very moment of creation**.

If you haven't run into that yet, you probably don't need it.

<div class="hr" />

## The two moments when Treble writes

This is the distinction almost every limitation comes from.

| Moment | What happens | What controls it |
| - | - | - |
| **Creation** | Treble doesn't find the person's record and creates it | The required fields Treble detects automatically, plus the advanced rules on this page |
| **Update** | The record already exists and Treble writes a field | The blocks in your flow |

The blocks you configure in the conversation builder work in the **second** moment. Each block writes a field **after** the record exists.

That works perfectly as long as Salesforce allows that field to be written afterward. It stops working when Salesforce requires something **on creation**.

<Warning>
  The two cases that come up most:

  * **A validation rule** that requires a value in order to create the record (for example, a data processing authorization).
  * **The record type**, particularly with [Person Accounts](/en/docs/integrations/salesforce/features/person-accounts): an account can't be converted into a Person Account after it's created.

  In those cases, the flow block arrives too late by design.
</Warning>

<div class="hr" />

## Creation rules

For those cases, Treble can apply **rules that run at the moment the record is created**, configured per object within your integration.

The key property: a creation rule **always** applies when the record is created, regardless of whether Salesforce reports that field as required or not. That's why it solves what a block can't reach.

### What you can do

<AccordionGroup>
  <Accordion title="Fixed value">
    The most common: *"every record this integration creates must have X in this field"*.

    It works for record types, yes/no flags, lead source, default country, internal classifications, and in general any required field in your model that doesn't depend on the conversation.

    It's also the fastest change to apply.
  </Accordion>

  <Accordion title="Value derived from the WhatsApp contact">
    Treble knows the contact and can derive values from it: the WhatsApp profile name, the phone number in different formats, the email if it has one, or a generated email when it doesn't.

    It's the usual way to fill in required name or email fields on objects that require them.
  </Accordion>

  <Accordion title="Custom logic">
    When you need your own transformation —trimming a document to a certain number of digits, translating a value into your internal nomenclature, composing a field from several pieces of data— a specific rule can be written for your account.

    It's not an exceptional case, but it **requires development on Treble's side**: it's requested, coded and deployed.
  </Accordion>

  <Accordion title="Values taken from the conversation">
    It's also possible for a rule to use what the person answered during the conversation and include it when the record is created.

    It's the way to go when you need, for example, the record type to depend on what the person chose in the chat **and** for that to be set from the moment of creation. Like the previous case, it requires development.
  </Accordion>
</AccordionGroup>

<div class="hr" />

## The limits worth knowing

There are three, and it's worth being clear on them before designing something around this tool.

<AccordionGroup>
  <Accordion title="1. They apply to the whole integration, not to a flow">
    A rule on the `Account` record type affects **all** the accounts the integration creates, in **all** flows.

    Today you can't have "campaign A creates with one record type and campaign B with another" using creation rules. This is the most important limitation.

    <Info>
      If that's exactly your case, let your Customer Success Manager know: it's one of the things we're working on, and it helps to know how many customers need it.
    </Info>
  </Accordion>

  <Accordion title="2. They only apply on creation">
    A creation rule doesn't run when the record already exists. To update an existing record, you use the flow blocks, as always.
  </Accordion>

  <Accordion title="3. They aren't self-service yet">
    These rules live in the integration's configuration and are applied by the Treble team. They can't be edited from the platform.

    A change is usually quick —minutes, with no deployment, when it's a fixed value— but it goes through us.
  </Accordion>
</AccordionGroup>

<div class="hr" />

## Other things configured at this level

<AccordionGroup>
  <Accordion title="The phone field for lookup and writing">
    It's the field Treble uses to look up the person and, at the same time, where it writes the number when it creates the record.

    <Warning>
      Today it's **a single field for both things**. If you change the field so the number is saved somewhere else, Treble stops finding the records that have the number in the previous field and starts creating duplicates.

      If you need to look up by one field and write to another, talk to your Customer Success Manager before changing anything.
    </Warning>
  </Accordion>

  <Accordion title="Task or Event for the history">
    Defines whether the conversation history is saved as a `Task` or as an `Event`.

    <a class="article-link" href="/en/docs/integrations/salesforce/features/activities"><p>Conversation history</p><Icon icon="arrow-up-right-from-square" iconType="solid" /></a>
  </Accordion>

  <Accordion title="The objects of the multi-object integration">
    Which objects the integration uses, and for each one its phone, name and owner field. It's defined during installation, and changing it afterward means reinstalling.
  </Accordion>
</AccordionGroup>

<div class="hr" />

## Two frequently asked cases

<AccordionGroup>
  <Accordion title="Saving the phone number in a different format">
    By default, Treble writes the number in full international format, with the country code. It's very common to want something else: without the country code, with parentheses and spaces, or split into two fields.

    That's solved with a **creation rule** on the phone field. If the format you need is a simple transformation of the number, it's a quick change; if it depends on rules specific to your operation, it falls into the custom logic category.

    <Warning>
      Watch out for a side effect: the integration's phone field is the same one Treble uses to **look up** the person. If you change the format of what's written, make sure the lookup still finds existing records, or you'll start creating duplicates.
    </Warning>
  </Accordion>

  <Accordion title="Which name the contact is created with">
    When Treble creates the record, the name comes from the person's **WhatsApp profile**. But that name doesn't always exist and isn't always useful: there are users without a profile name, and there are profiles with emojis or promotional text.

    You can define with a creation rule what gets written in that case: a fixed fallback value, the phone number, or a combination. That's exactly what several customers do so that no record is left without a name and so that records created by Treble are identifiable.

    <Info>
      If what you see is the **text of a message** in the name field, that's not the creation: it's an action block writing the person's reply to the wrong field. Check [the action block](/en/docs/integrations/salesforce/blocks/crm-action).
    </Info>
  </Accordion>
</AccordionGroup>

<div class="hr" />

## How to request a change

To make it quick, write to your Customer Success Manager with this information:

<Steps>
  <Step title="The object">
    For example `Account`, `Lead`, or the API name of your custom object.
  </Step>

  <Step title="The field">
    The exact **API name**, not the label you see on screen. For example `CC_Autorizacion__c`, not "Data authorization".
  </Step>

  <Step title="The value">
    If it's a fixed value, which one. If it's a record type, the **18-character Id**, which you'll find in *Setup → Object Manager → your object → Record Types*, in the type's URL.
  </Step>

  <Step title="Why a block isn't enough">
    Usually: "there's a validation rule that requires this field on creation", or the exact error message Salesforce returns. That saves an entire round of questions.
  </Step>
</Steps>

<div class="hr" />

## Next steps

<CardGroup cols={2}>
  <Card title="Record types" icon="layer-group" href="/en/docs/integrations/salesforce/features/record-types">
    The most common case of a field that must be filled in on creation.
  </Card>

  <Card title="Person Accounts" icon="user" href="/en/docs/integrations/salesforce/features/person-accounts">
    When an account represents a person rather than a company.
  </Card>
</CardGroup>


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.