SetPersonaAttribute

The SetPersonaAttribute action sets a value for a specific attribute on a given persona. This is useful for storing persona-level data such as custom fields, preferences, or tracking information.

SetPersonaAttribute(
    id: str,
    field: str,
    value: str
)

Where:

  • id: The UUID of the persona whose attribute you want to set.
  • field: The name of the attribute to set.
  • value: The value to assign to the attribute.

Example

{{Set(name="user_id", value=GetUser(field="id"))}}

{{SetPersonaAttribute(id=user_id, field="preferred_language", value="English")}}

{{SendMessage(message="Preference saved.")}}

The above code snippet sets the "preferred_language" attribute for the current user's persona to "English."