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 :
Power Platform Community / Forums / Power Apps / Error on Form Formula
Power Apps
Unanswered

Error on Form Formula

(0) ShareShare
ReportReport
Posted on by

Hi,

 

I am new to PowerApps and trying to learn by the same apps on youtube and other resources.

Now I am following one of the videos on youtube (https://www.youtube.com/watch?v=F7OZVjjF2kg) and getting error in last at form level however I have tried my best but the error still exists.

In this video Gmail function is used to send an email however i just made changes it to Office365 otherwise tried to copy all the same but getting error as shown below.

 

MicrosoftTeams-image (4).png

Video time (28:31 to 28:54)

Below is the code on which I get the error.

 

UpdateContext({varSubmit:false});
Office365Outlook.SendEmailV2(Form1.LastSubmit.ContactPersonMail,
{
Subject: "Visitor at reception: ID# "& Form1.LastSubmit.ID,
Body: "<strong> Dear " & Form1.LastSubmit.ContactPersonName&"</Strong><br/><br/> There is a Visitor for you. <br/><br/><table width='100%' border='1'cellpadding='5' style='border:1px solid black; border-collapse:collapse'>" & "<tr style='background-color:#efefef'><th style='text-align:left'>Visitor Name</th><th style='text-align:left'> Reason </th> <th style='text-align:left'> Visitor Address</th>
<tr>
<td>" & Form1.LastSubmit.VisitorName & "</td>
<td>" & Form1.LastSubmit.Reason & "</td>
<td>" & Form1.LastSubmit.Address & "</td>
</tr>
 
</tr></Table><br/>Please reply to this mail to convey your message to the visitor.
<br/><br/><strong>Thanks & Regards
<br/>Visitor Team
</strong>",
IsHtml: true
}
);NewForm(Form1);

 

Categories:
  • RandyHayes Profile Picture
    76,299 Super User 2024 Season 1 on at

    @osamamansoor 

    Please consider changing your formula to the following:

     

    UpdateContext({varSubmit:false});
    
    Office365Outlook.SendEmailV2(
     Form1.LastSubmit.ContactPersonMail,
     "Visitor at reception: ID# "& Form1.LastSubmit.ID,
     "<strong> Dear " & Form1.LastSubmit.ContactPersonName & "</Strong><br/><br/> 
     There is a Visitor for you. <br/><br/>
     <table width='100%' border='1'cellpadding='5' style='border:1px solid black; border-collapse:collapse'>
     <tr style='background-color:#efefef'>
     <th style='text-align:left'>Visitor Name</th>
     <th style='text-align:left'> Reason </th> 
     <th style='text-align:left'> Visitor Address</th>
     </tr>
     <tr>
     <td>" & Form1.LastSubmit.VisitorName & "</td>
     <td>" & Form1.LastSubmit.Reason & "</td>
     <td>" & Form1.LastSubmit.Address & "</td>
     </tr>
     </Table><br/>
     Please reply to this mail to convey your message to the visitor.<br/><br/>
     <strong>Thanks & Regards<br/>
     Visitor Team</strong>"
    );
    
    NewForm(Form1);

     

     

    Note: this should be on the OnSuccess action of your Form.

     

    I hope this is helpful for you.

     

    EDIT: noticed an extra comma in my response.  The above formula has been corrected.

  • osamamansoor Profile Picture
    on at
  • osamamansoor Profile Picture
    on at
    Spoiler (Highlight to read)
     
     

    Thanks for your response.

     

    But getting more error while putting your code and all relevant screenshots and application monitor data placed at the below link.

     

    https://crescentpk-my.sharepoint.com/:f:/g/personal/osama_mansoor_crescent_com_pk/Ehj8qcGdUU9Dp8x9xjO501cBh04LYZnMqVF-g8_6O3YQ4Q?e=K87S2b

  • osamamansoor Profile Picture
    on at

    Also, other few issues with the above mentioned

     

    Getting different error On-success of form also unable to take capture image and once the record submitted all forms filed go blank.

  • RandyHayes Profile Picture
    76,299 Super User 2024 Season 1 on at

    @osamamansoor 

    Can you please provide a screenshot of the formula in the formula bar in the designer with any red errors shown?

    You can place this directly in your reply to the message by taking your screen shot and then just pasting it into your reply.  There is no need for additional links to files to do this.

  • osamamansoor Profile Picture
    on at

    After your forumla.

    2-1.JPG
    2-2.JPG
  • RandyHayes Profile Picture
    76,299 Super User 2024 Season 1 on at

    @osamamansoor 

    So I do not see any error in what you have.  Your picture of the form shows there is an error, but you have not provided what that error is yet.

    Please hover over the red circled x on the screen and see what the error is.  Then click on the dropdown arrow next to the x and choose Edit in the Formula Bar.  Then see what the formula is that it is complaining about.

  • osamamansoor Profile Picture
    on at

    Thanks for your reply.

    1.jpg2.jpg3.jpg4.jpg

  • RandyHayes Profile Picture
    76,299 Super User 2024 Season 1 on at

    @osamamansoor 

    My guess in looking over those pictures is that your ContactPersonName is NOT a text column.  Is it by chance a Person column?  If so, then you need to add to the end of it .Email

    So - ContactPersonName.Email

  • osamamansoor Profile Picture
    on at

    Still getting errors

    MicrosoftTeams-image (8).png

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 Winners!

Congratulations to our community stars!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Leaderboard > Power Apps

#1
11manish Profile Picture

11manish 360 Super User 2026 Season 2

#2
M Bilal Khan Profile Picture

M Bilal Khan 325

#3
Mohsin Ali Profile Picture

Mohsin Ali 232

Last 30 days Overall leaderboard