The code works BUT obviously pastes the logged in user’s full name in the first name field in Acuity.
Ignore the current last name line as it’s not yet right.
The email field does work!
What I need is a first name field and last name field for the logged in user in softr. I’ve been told by softr support that the user name field can’t be broken down to first and last names and I can’t map the user name field to a concatenated field in AirTable, can only map to a text field. What parameters in softr can I use to make my form code prefil my acuity form with the first name and last name pf the logged in user. By the way, I asked Acuity if I could edit there scheduling form and use a full name field instead of a first name field and last name field and unfortunately, that form is not editable. So, I have first name and last name fields in Acuity but only a full name field in Softr. Please help!
{LOGGED_IN_USER: yourFieldName} is supported for getting logged-in user data. So find the field names for your first and last name, and update accordingly.
The AirTable field names are firstName and lastName. I tried acuityUrl += '&firstName=' + encodeURIComponent(window['logged_in_user']['LOGGED_IN_USER:firstName']); and acuityUrl += '&firstName=' + encodeURIComponent(window['logged_in_user']['{LOGGED_IN_USER:firstName}']); Neither worked. Coding isn’t my sstrong point, as you can guess.
Might I suggest using our conditional forms instead? And then sending those results to your automation / API call so you can get the exact details you need without coding? It’s not my strong suit either!!
To be inserted in the header custom code of the page settings.
Also, do a test in live mode, not only within the preview mode.
In these two lines below, careful, FirstName and LastName are the exact field names in my users table. You would need to change your airtable fields “firstName” and “lastName” by “FirstName” or “LastName” – Or any other field names that are not firstName or lastName – otherwise it will mess everything up.
let firstNameData = window['logged_in_user']['FirstName'] || '';
let lastNameData = window['logged_in_user']['LastName'] || '';