Toronto Power BI, Power Apps, Power Automate User Group

Please login or click SIGN UP FOR FREE to create your PowerPlatformUG account to join this user group.
 View Only
  • 1.  Error on Form Formula

    Posted Oct 09, 2020 01:40 PM

    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.

    All ScreenShots are there

     

    https://crescentpk-my.sharepoint.com/:f:/g/personal/osama_mansoor_crescent_com_pk/Evk9xBcXQ4ZFre4avE...

    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);


    ------------------------------
    Osama Mansoor
    AM IT
    ------------------------------


  • 2.  RE: Error on Form Formula

    Bronze Contributor
    Posted Oct 13, 2020 10:42 AM
    Hi Osama,
    There might be more to it than I found, but I found two HTML typos: 1) missing space in "border='1'cellpadding='5'" on line 6, and 2) </tr> elements not in the right place (lines 8 and 15, basically) - the table headers row (<th> elements) isn't closed, and the table details row (<td> elements) has two closing table rows (</tr> elements in a row).
    Try below and see if that takes care of the problem. Thanks!
    -Rob

    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>
    <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>",
    IsHtml: true
    }
    );NewForm(Form1);


    ------------------------------
    Rob Clark
    Cambridge
    ------------------------------



  • 3.  RE: Error on Form Formula

    Posted Oct 14, 2020 01:00 AM
    Thanks for your response but still getting an error.



    ------------------------------
    Osama Mansoor
    AM IT
    ------------------------------



  • 4.  RE: Error on Form Formula

    Bronze Contributor
    Posted Oct 14, 2020 11:23 AM
    Check the location of your curly braces. The connector appears to expect them to be around the fourth parameter through the last parameter. You've got a curly left brace after parameter one.


    ------------------------------
    Rob Clark
    Cambridge
    ------------------------------



  • 5.  RE: Error on Form Formula

    Posted Oct 15, 2020 01:26 AM
    Thanks for your reply can you please make suggested changes in your above-given code as I am not 100 % able to understand the changes you suggested in last post.

    ------------------------------
    Osama Mansoor
    AM IT
    ------------------------------



  • 6.  RE: Error on Form Formula

    Bronze Contributor
    Posted Oct 15, 2020 03:47 PM
    This, basically - hopefully that is all you need!

    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>
    <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>",
    {
    IsHtml: true
    }
    );NewForm(Form1);


    ------------------------------
    Rob Clark
    Cambridge
    ------------------------------



  • 7.  RE: Error on Form Formula

    Posted Oct 16, 2020 03:42 AM
    Sorry to say you that still getting error.


    ------------------------------
    Osama Mansoor
    AM IT
    ------------------------------