web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Microsoft Dynamics 365 | Integration, Dataverse...
Answered

Set Email "From" Field to General Support Email

(0) ShareShare
ReportReport
Posted on by 45

I am trying to set the email "From" field to a specific email address/user OnLoad.  I have done something similar for the "Subject" field using javascript and added it as web resource to the form but I've been unsuccessful in doing so for the "From" field.  I do not know javascript specifically but I know enough to modify it for my needs if I find something similar that someone has written.  That is how I achieved the "Subject" line fix.  Does anyone know how I can set the "From" field on the email form to a specific user OnLoad? I don't believe I can get a flow to do this but if someone knows a way I am all ears!

Any help is greatly appreciated.

Thanks!

I have the same question (0)
  • Verified answer
    Community Member Profile Picture
    on at

    Hi lawilliams713,

    You can use the following js code: 

    function setSender(executionContext) {
        var formContext = executionContext.getFormContext();
        var lookup = new Array();
        lookup[0] = new Object();
        lookup[0].id = "8c68629d-5555-ec11-8f8f-000d3a5b22fe";
        lookup[0].name = "Eric Gruber (Sample Data)";
        lookup[0].entityType = "systemuser";
        formContext.getAttribute("from").setValue(lookup);
    }

    Result:

    pastedimage1647488168870v1.png

    Note:

    pastedimage1647488497701v2.png

  • lawilliams713 Profile Picture
    45 on at

    Ah! So simple!!!  Worked like a charm.  Thank you!

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Season of Sharing Community Challenge Launch!

Jump in, show your community spirit, and win prizes!

Women in Power Builds Momentum

Expanding mentorship, skilling, and AI innovation

Congratulations to the May Top 10 Community Leaders

These are the community rock stars!

Leaderboard > Microsoft Dynamics 365 | Integration, Dataverse, and general topics

#1
11manish Profile Picture

11manish 129

#2
Subra Profile Picture

Subra 126

#3
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 101 Super User 2026 Season 1

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans