Skip to main content

Hi,
I'm trying to collect users' first names using a User Input block. However, when users type responses like "My name is James," the entire sentence is saved in the field instead of just the first name. I need a way to restrict or validate inputs so only the first word (e.g., "James") is saved, without spaces or additional text.

Currently, ManyChat doesn't allow me to set a restriction for spaces or validate input directly. Is there a way to handle this, or can you suggest a workaround?

Thanks in advance for your help!

@Shibald you need to integrate something else to ‘clean up’ the name, and then use the API to update the person’s name in Manychat.

You can do that with tools like Make.com. My favorite though is to use AI, with a prompt like:

“You’re a text processor and your job is to extract the user’s first name from the text entered. Reply only with the first name, no additional text. If you cannot find a name, reply with exactly NOT FOUND.”

You save that to a Use Field, then update the First Name System field with the updateSubscriber API endpoint.


Hey, ​@Shibald!

 

The best (and easiest) way may be asking your contacts just to send their first name…

 

Or you could use some AI integration to send the input and ask to isolate only the name/ first name. It will cost you some tokens, but could solve your problem.

 

Hope this helps!
🙌


Reply