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

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / Add email template whe...
Power Apps
Unanswered

Add email template when creating email activity record with Javascript

(0) ShareShare
ReportReport
Posted on by 65

Hello,

 

I am creating an email activity (Timeline) and want to include an existing email template when it is created.

 

The last line of code in the example shown is not working. It does not create an error but appears to be simply ignored. Everything else is working great.

 

Any ideas as to how to resolve this are appreciated.

kcward55_0-1713372627365.png

 

I have the same question (0)
  • a33ik Profile Picture
    3,306 Most Valuable Professional on at

    Hello,

    What you developed is not intended to work. If you want to send an email based on the template you should use the "SendTemplate" message. In order to precook initial version of JavaScript I would recommend using XrmToolbox and Dataverse Rest Builder plugin

  • kcward55 Profile Picture
    65 on at

    Hi @a33ik 

     

    Thanks so much for your reply.

    I don't think "SendTemplate" is going to work for me in this case.

     

    I am creating an 'email activity' in a timeline and my intent is that the 'email activity' is created in draft status, which the user can then edit as required before sending.

     

    The email template to be used is easily determined based on conditions in the 'regarding' record, but if I am not able to specify the template to be used when the record is created, the user will have to do that manually.

    If you have any other suggestions I would appreciate it very much.

    Thanks again for getting back to me.

  • Verified answer
    a33ik Profile Picture
    3,306 Most Valuable Professional on at

    Gotcha!

    In this case, if you want just to create an email it'll be 2 steps operation:

    1. Use the InstantiateTemplate message to create an email placeholder.

    2. Use this placeholder to populate from/to other required fields.

  • kcward55 Profile Picture
    65 on at

    Hi @a33ik 

     

    Based on the reading I have done as a result of your reply, I am certain that your suggestion is what I need to do in order to achieve the result I am looking for. 

    Being a self-taught rookie with Power Apps and JavaScript it will probably take me some time to work through it. 

    In the meantime I will mark this as the 'accepted solution'.

    Thanks again for your help. I really appreciate it.

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

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 717 Most Valuable Professional

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 329 Super User 2025 Season 2

#3
Power Platform 1919 Profile Picture

Power Platform 1919 268

Last 30 days Overall leaderboard