Auto-Fill based on user email and filtering

I have a form that members will fill out with volunteer hours worked and I am trying to make it easier and faster for them by having the initial input fields auto-fill with their details (Full Name, Email, and Membership #) as soon as they access the form. Besides the Private Members Database created automatically with login, I have a separate more robust membership roster with all of their details. I am still fairly new to coding so I am learning as I go.

I was able to successfully add the code seen below (the portion above the blue line) that pulled their email address (which will be the same in both databases) since they are logged in and then had it auto-fill their email in the specific email input line. The trouble I am having how is having the code use the login email to return results from the bigger database to fill in the Full Name and Membership # fields. I tried a couple different things I found including the code from the Vorbly site however I could not get any of those to return any results.


Then I tried a different approach where I created another dataset on the page linked to the bigger database and then linked it to both the Full Name and Membership ID Input boxes. The idea was to have the login email filter out the dataset to show the values from the respective fields in the inboxes and then I would have a setfieldvalue command connected to the submit button to add those details along with the other manual input worked hour info to the form submission database.

The code below the blue line is what I tried to use last however I still could not get it to filter the dataset to return the correct values. Any suggestions or help would be appreciated. Thank you!

Hi Chad,

You may have already tried this, but what happens if you use userEmail in the filter condition rather than the just assigned “MemberEmail” input? You might also put a console.log(email) after the .then line to make sure it’s returning the email address you expected.

Hello again, Anthony! The userEmail replacement works the same way as the other in the picture. That just happened to be the last modification I did while testing. I had actually since changed it back to userEmail since I captured that screenshot. Both work and input the correct email address in the Email Input Box. I used a separate browser window with separate login credentials to test this. I added the console code and it is also showing the correct email in the log. So that part is actually working as expected.

The part I am stuck at is either: 1) using additional code that uses the correct login email address returned from the first part of the code as the reference to pull the other 2 pieces of info directly from the main central database (the one that pulled data for that other form you helped me with before) or 2) using code to filter out a separate dataset linked to those 2 input fields (Full Name and Membership #) to help pull the data as soon as the form is opened (no retrieve button this time).

I had tried a couple of codes found in the forum linked to the user ID / name and then tried changing it to reference the userEmail result but that did not work. I could not get the code from the vorbly site example to work, and I also tried (but may not have done it correctly) to create a modified code version from the one we came up with for that other form.