Pull primary SMTP proxy address from account control

Hi all,

We have a form that populates the signed in user. The issue I'm running into is it uses the email field in the user's profile, which is our domain address, but we use a different domain as our primary SMTP proxy address.

Is there a javascript call similar to

fd.field('ApprovalEmail').value = fd.account.username;

or

fd.field('ApprovalEmail').value = fd.control('Account1').email

that would pull an SMTP proxy instead of the email field?

Dear @t.sheehy,
Well, you need to pull the data from somewhere and if it's not the same as user's email, that could be tricky. If the difference is just the mailbox, you can simply replace it with JS - JavaScript String replace() Method

Are you working with public web forms or SharePoint forms?

Public web forms. It would also work with just the username without the domain after it.

Dear @t.sheehy,
For example, you can get just the username without the domain like so:

fd.field('ApprovalEmail').value = fd.account.username.split('@')[0];

Or add a custom domain:

fd.field('ApprovalEmail').value = fd.account.username.split('@')[0] + '@gmail.com';