Skip to main content
All CollectionsForm BuilderForm Scripting & Calculations
Accessing data and writing data to Phone Number Fields using Lua
Accessing data and writing data to Phone Number Fields using Lua

How to pull out phone number information from a Phone Number Field, and write Phone Numbers, using our scripting language

Angela Lim avatar
Written by Angela Lim
Updated over 4 years ago

If you need to read data from or write data to a Phone Number field, you can do so using our scripting language Lua.

To access this information, make sure the Phone Number field in your form has a slug.

To write your script, simply assign the slug of the field you need to write an answer to to the Phone Number field that you need. See below for an example (where phone_number is the name of the slug you've assigned to your Phone Number field, and calculated_phone_number is where you're putting the Phone Number):

answers.calculated_phone_number = answers.phone_number

Click Save Changes.

When a new form result is created, and the Phone Number field is filled out, your answer will automatically be populated!

Did this answer your question?