Skip to main content

Notifications

Community site session details

Community site session details

Session Id :
Power Apps - Building Power Apps
Answered

Adding User Entered Text into Email Subject

(0) ShareShare
ReportReport
Posted on by

Hi Experts,

 

I'm sending an email upon a user completing my app using Office365Outlook.SendEmailV2. The email lists everything that the user has filled out during the form and i'm wanting one of the results that they have entered in a Text input box to be put in the Subject of the email. The name I have given to the Text input box is Job Number.

 

Thanks in advance! 

  • Dave-ITMan Profile Picture
    on at
    Re: Adding User Entered Text into Email Subject

    That's great thank you so much! I don't suppose you know how I can include the attachments that have been sent in the email to also attach into my sharepoint list do you please using the code above? 

  • Verified answer
    Nogueira1306 Profile Picture
    7,390 Super User 2024 Season 1 on at
    Re: Adding User Entered Text into Email Subject

    ClearCollect(CollectAttachments, AttachmentControl.Attachments); ClearCollect(SignatureCollection, {Signatures:Signature.Image});

    Office365Outlook.SendEmailV2("firstname.lastname@companyname.com" , JobNumber.Text , "Hi,<br><br>

    Please see completed form below and attached images<br><br>

    <a href=https://companyname.sharepoint.com/sites/PowerApps/Lists/TestForm/AllItems.aspx>Click Here to View the Full SharePoint List</a><br><br>

    <b>Customer: </b>"&Customer.Text&"<br>
    <b>Address: </b>"&Address.Text&"<br>
    <b>Job Number: </b>"&'Job Number'&"<br>
    <b>Date: </b>"&Date.SelectedDate&"<br><br>

     

    Regards<br></br>

    {Attachments: AddColumns( RenameColumns (AttachmentControl.Attachments,"Value", "ContentBytes"), "@odata.type", "")});
    Patch(TestForm, Defaults(TestForm),

    {
    Title: ValueDateTimeNow.Text,
    Customer: Customer.Text,
    'Site Address': Address.Text,
    'Job Number': 'Job Number'.Text,
    Date: Date.SelectedDate

    });
    Navigate(Success,Cover)

  • Dave-ITMan Profile Picture
    on at
    Re: Adding User Entered Text into Email Subject

    Hi,

    Thanks for the quick reply. I'm not sure what the form ID is referring to? It's the Job number listed that I need to show in the subject of the email. 

    My code is below if that helps?

     

    ClearCollect(CollectAttachments, AttachmentControl.Attachments); ClearCollect(SignatureCollection, {Signatures:Signature.Image});

    Office365Outlook.SendEmailV2("firstname.lastname@companyname.com" , "Subject Here" , "Hi,<br><br>

    Please see completed form below and attached images<br><br>

    <a href=https://companyname.sharepoint.com/sites/PowerApps/Lists/TestForm/AllItems.aspx>Click Here to View the Full SharePoint List</a><br><br>

    <b>Customer: </b>"&Customer.Text&"<br>
    <b>Address: </b>"&Address.Text&"<br>
    <b>Job Number: </b>"&'Job Number'&"<br>
    <b>Date: </b>"&Date.SelectedDate&"<br><br>

     

    Regards<br></br>

    {Attachments: AddColumns( RenameColumns (AttachmentControl.Attachments,"Value", "ContentBytes"), "@odata.type", "")});
    Patch(TestForm, Defaults(TestForm),

    {
    Title: ValueDateTimeNow.Text,
    Customer: Customer.Text,
    'Site Address': Address.Text,
    'Job Number': 'Job Number'.Text,
    Date: Date.SelectedDate

    });
    Navigate(Success,Cover)

  • Nogueira1306 Profile Picture
    7,390 Super User 2024 Season 1 on at
    Re: Adding User Entered Text into Email Subject

    Office365Outlook.SendEmailV2(User().Email, JobNumber.Text, "Form ID" & Form.DataCardValue.Text)

    You can also use Form.LastSubmited.ID, for example

     

    If you need additional help please tag me in your reply and please like my reply.
    If my reply provided you with a solution, pleased mark it as a solution ✔️!

    Best regards,
    Gonçalo Nogueira

    Check my LinkedIn!

    Check my User Group (pt-PT)!

    Last Post on Community

    My website!

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

🌸 Community Spring Festival 2025 Challenge 🌸

WIN Power Platform Community Conference 2025 tickets!

Markus Franz – Community Spotlight

We are honored to recognize Markus Franz as our April 2025 Community…

Kudos to the March Top 10 Community Stars!

Thanks for all your good work in the Community!

Leaderboard

#1
WarrenBelz Profile Picture

WarrenBelz 146,537 Most Valuable Professional

#2
RandyHayes Profile Picture

RandyHayes 76,287 Super User 2024 Season 1

#3
Pstork1 Profile Picture

Pstork1 65,908 Most Valuable Professional

Leaderboard