Change field value automation
The Change field value automation sets a field on the visitor's profile when they interact with a widget element. It records what a click means without asking the visitor to type anything: "I'm a wholesale buyer" sets Customer type to Wholesale, "Remind me later" sets Wants reminder to yes. The value can then drive targets, conditional actions, dynamic text, integrations and exports.
Available on: all platforms.
How it works
- You add Change field value to an element, pick a Field and enter the Value.
- When the element's event happens, the visitor's profile is updated in their browser straight away, so dynamic text and conditional actions on the widget see the new value.
- The value is sent with the element's event and saved to the visitor's profile on Personizely's servers.
Configuration
Option | What it does | Values / default |
|---|---|---|
Field | The default or custom field to set. Archived fields are listed with "(archived)" | Any field |
Value | The value to set. The input matches the field type | Text, number, checkbox, choice, multiple choice or date |
JS Value | (text, email, phone and textarea fields) Treat Value as JavaScript: the label changes to JavaScript code | Off by default |
JS Value
With JS Value on, Personizely evaluates what you enter in the visitor's browser when the event happens:
- a global variable path, such as Shopify.locale or dataLayer.0.page_type, or
- a JavaScript expression, such as document.title or new Date().toISOString().
If the result is empty or the code fails, the text you entered is saved as is.
Behavior details and limitations
- What the visitor typed wins. On a Form, values the visitor entered take precedence over automation values for the same field.
- Values overwrite. Each visitor has one profile; a new value replaces the old one.
- Identifying fields. Setting a field such as email or phone can turn an anonymous visitor into a contact.
- Works with any event that's recorded. Clicks, submits, timer and cart-progress completions and wheel spins all carry the value. A Button with No action still records its click when it has this automation.
- JS Value runs your code. Like Execute JavaScript code, it doesn't run on Webflow sites connected through the Webflow integration, and a Content Security Policy must allow 'unsafe-eval'.
- Preview doesn't save. In preview the browser profile changes, but nothing is saved to the server.
Examples
- Segment by intent: two buttons, "For me" and "As a gift", each setting the custom field Purchase intent. A target "Purchase intent is Gift" then shows gift-wrap offers.
- Capture the page: a form with Change field value on a custom text field, JS Value on, code location.pathname, to store where the visitor signed up.
- Consent with a click: "Yes, send me offers" sets Email marketing consent to checked.
Troubleshooting
- Field has the visitor's value, not yours → the form also has an input for that field, and what the visitor typed wins.
- JS Value saves the code as text → the code returned an empty value or threw an error in the visitor's browser.