cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
drewski
Level: Powered On

Accessing associated Flow(s) from Template Apps

I created the new 'Shoutouts' template app today and I was trying to locate the function that sends an email to your manager as I want to disable this (as our team sends a lot of kudos and this will clog up our boss' email)

 

I was assuming since it's sending an email through Outlook there was an associated FLOW with it, that I should be able to just disable (or alter the conditions to remove the 'send email to manager' piece).. but I was unable to figure out how to do this - it doesn't seem to show any Flows associated to it... When I click the 'submit' button and goto "Flow" it just shows workflows I've created in the past.. I either can't find the right spot, or this function doesn't exist yet..

 

Any ideas where to locate this code/ and or Flow so I can change this around?

1 ACCEPTED SOLUTION

Accepted Solutions
Community Support Team
Community Support Team

Re: Accessing associated Flow(s) from Template Apps

Hi @drewski,

 

This sample app doesn't use a Flow to send the email, it connect to Office 365 Outlook and use the Office365.SendEmail function to send the email. Please check the OnSuccess property of the Form1:

Set(AppURL, "https://web.powerapps.com/apps");
If(IsBlank(emailHtml), UpdateContext({emailHtml:
"<html>

<head>
    <meta http-equiv=""Content-Type"" content=""text/html; charset=us-ascii"">
    <meta http-equiv=""Cache-Control"" content=""no-siteapp"">
    <meta name=""viewport"" content=""width=device-width, initial-scale=1.0,maximum-scale=1.0, user-scalable=no"">
    <style type=""style/css"">
        table, table td {border-collapse: collapse;}
    </style>
    <link href=""http://fonts.font.im/css?family=Open&#43;Sans:400,400italic,700"" rel=""stylesheet"" type=""text/css"">
</head>

<body>
    <table border=""0"" cellpadding=""0"" cellspacing=""0"" width=""640"" style=""background:#4d4d4d;"">
        <tr>
            <td width=""547"" height=""80"" style='font-family: ""Open Sans"", sans-serif;color:white;font-weight: bold;text-align: Center;font-size:24px;mso-fareast-font-family:""Open Sans"";border-collapse: collapse;'>Shoutouts</td>
        </tr>
    </table>
    <table border=""0"" cellpadding=""0"" cellspacing=""0"" width=""640"">
        <tr>
            <td colspan=""2"">
                <table border=""0"" cellpadding=""0"" cellspacing=""0"">
                    <tr>
                        <td width=""20""></td>
                        <td height=""110"" width=""600"" style='font-family: ""Open Sans"", sans-serif;text-align: left;font-size:24px;mso-fareast-font-family:""Open Sans"";'>
                            Hi " & UserSelected & ","& "
                        </td>
                        <td width=""20""></td>
                    </tr>
                    <tr>
                        <td></td>
                        <td width=""600"" style='font-family: ""Open Sans"", sans-serif;text-align: left;font-size:24px;mso-fareast-font-family:""Open Sans"";mso-line-height-rule:exactly;line-height:36px;'>
                            Congratulations! Your colleague " & User().FullName & " has sent you " & If(IsMatch(SelectedType.Type, "[AEIOUaeiou]", BeginsWith), "an ", "a ") & " <b>" & Upper(SelectedType.Type) & "</b> shoutout. To view it, open the Shoutouts app.
                        </td>
                        <td></td>
                    </tr>
                    <tr>
                        <td height=""40""></td>
                    </tr>
                    <tr>
                        <td></td>
                        <td>
                            <table border=""0"" cellpadding=""0"" cellspacing=""0"" width=""100%"">
                                <tr>
                                    <td width=""209"">
                                    </td>
                                    <td width=""180"" height=""34"" style='font-family: ""Open Sans"", sans-serif;mso-fareast-font-family:""Open Sans"";text-align:center;border: solid 1px #b7b7b7;font-size: 14px; font-weight: bold;border-radius: 5px;'>
                                        <a href=" & AppURL & " style=""text-decoration:none;color: #4d4d4d;"">Open Shoutouts</a>
                                    </td>
                                    <td width=""209"">
                                    </td>
                                </tr>
                            </table>
                        </td>
                        <td></td>
                    </tr>
                    <tr>
                        <td height=""96""></td>
                        <td>
                            <table border=""0"" cellpadding=""0"" cellspacing=""0"" width=""100%"">
                                <tr>
                                    <td width=""28"">
                                    </td>
                                    <td width=""544"" height=""96"" style=""border-bottom:1px solid #cccccc;"">
                                    </td>
                                    <td width=""28"">
                                    </td>
                                </tr>
                            </table>
                        </td>
                        <td></td>
                    </tr>
                    <tr>
                        <td height=""28""></td>
                    </tr>
                    <tr>
                        <td></td>
                        <td width=""600"" style=""
                        font-size: 16px;
                        line-height: 24px;
                        font-style: italic;
                        margin-top:30px;mso-line-height-rule:exactly;"">
                            The Shoutouts app allows you to recognize and appreciate your peers across the company. Try it today! Download and install the PowerApps player from your app store.
                        </td>
                        <td></td>
                    </tr>
                </table>
            </td>
        </tr>
    </table>
</body>

</html>"
}));
If(Not(UploadedImage1.Image = SampleImage),
    Office365.SendEmail(UserSelectedMail & ";" & Office365Users.Manager(UserSelectedPrincipalName).Mail, "Shoutout!", emailHtml,{IsHtml:true,Attachments:Table({Name:"ShoutoutAttachment.jpg", ContentBytes:UploadedImage1.Image, '@odata.type':""}),
     Importance:"normal"}),
     Office365.SendEmail(UserSelectedMail & ";" & Office365Users.Manager(UserSelectedPrincipalName).Mail, "Shoutout!", emailHtml, {IsHtml:true, Importance:"normal"}));
UpdateContext({emailHtml:""});
Navigate(SentConfirmationScreen,None)

Capture.PNG

If you do not want to send the email, you could delet the below part of the formula

If(
Office365.SendEmail(UserSelectedMail & ";" & Office365Users.Manager(UserSelectedPrincipalName).Mail, "Shoutout!", emailHtml,{IsHtml:true,Attachments:Table({Name:"ShoutoutAttachment.jpg", ContentBytes:UploadedImage1.Image, '@odata.type':""}),
Importance:"normal"}),
Office365.SendEmail(UserSelectedMail & ";" & Office365Users.Manager(UserSelectedPrincipalName).Mail, "Shoutout!", emailHtml, {IsHtml:true, Importance:"normal"}));
UpdateContext({emailHtml:""})

 

Please go ahead and have a try.

 

Regards,

Mona

Community Support Team _ Mona Li
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
2 REPLIES 2
Community Support Team
Community Support Team

Re: Accessing associated Flow(s) from Template Apps

Hi @drewski,

 

This sample app doesn't use a Flow to send the email, it connect to Office 365 Outlook and use the Office365.SendEmail function to send the email. Please check the OnSuccess property of the Form1:

Set(AppURL, "https://web.powerapps.com/apps");
If(IsBlank(emailHtml), UpdateContext({emailHtml:
"<html>

<head>
    <meta http-equiv=""Content-Type"" content=""text/html; charset=us-ascii"">
    <meta http-equiv=""Cache-Control"" content=""no-siteapp"">
    <meta name=""viewport"" content=""width=device-width, initial-scale=1.0,maximum-scale=1.0, user-scalable=no"">
    <style type=""style/css"">
        table, table td {border-collapse: collapse;}
    </style>
    <link href=""http://fonts.font.im/css?family=Open&#43;Sans:400,400italic,700"" rel=""stylesheet"" type=""text/css"">
</head>

<body>
    <table border=""0"" cellpadding=""0"" cellspacing=""0"" width=""640"" style=""background:#4d4d4d;"">
        <tr>
            <td width=""547"" height=""80"" style='font-family: ""Open Sans"", sans-serif;color:white;font-weight: bold;text-align: Center;font-size:24px;mso-fareast-font-family:""Open Sans"";border-collapse: collapse;'>Shoutouts</td>
        </tr>
    </table>
    <table border=""0"" cellpadding=""0"" cellspacing=""0"" width=""640"">
        <tr>
            <td colspan=""2"">
                <table border=""0"" cellpadding=""0"" cellspacing=""0"">
                    <tr>
                        <td width=""20""></td>
                        <td height=""110"" width=""600"" style='font-family: ""Open Sans"", sans-serif;text-align: left;font-size:24px;mso-fareast-font-family:""Open Sans"";'>
                            Hi " & UserSelected & ","& "
                        </td>
                        <td width=""20""></td>
                    </tr>
                    <tr>
                        <td></td>
                        <td width=""600"" style='font-family: ""Open Sans"", sans-serif;text-align: left;font-size:24px;mso-fareast-font-family:""Open Sans"";mso-line-height-rule:exactly;line-height:36px;'>
                            Congratulations! Your colleague " & User().FullName & " has sent you " & If(IsMatch(SelectedType.Type, "[AEIOUaeiou]", BeginsWith), "an ", "a ") & " <b>" & Upper(SelectedType.Type) & "</b> shoutout. To view it, open the Shoutouts app.
                        </td>
                        <td></td>
                    </tr>
                    <tr>
                        <td height=""40""></td>
                    </tr>
                    <tr>
                        <td></td>
                        <td>
                            <table border=""0"" cellpadding=""0"" cellspacing=""0"" width=""100%"">
                                <tr>
                                    <td width=""209"">
                                    </td>
                                    <td width=""180"" height=""34"" style='font-family: ""Open Sans"", sans-serif;mso-fareast-font-family:""Open Sans"";text-align:center;border: solid 1px #b7b7b7;font-size: 14px; font-weight: bold;border-radius: 5px;'>
                                        <a href=" & AppURL & " style=""text-decoration:none;color: #4d4d4d;"">Open Shoutouts</a>
                                    </td>
                                    <td width=""209"">
                                    </td>
                                </tr>
                            </table>
                        </td>
                        <td></td>
                    </tr>
                    <tr>
                        <td height=""96""></td>
                        <td>
                            <table border=""0"" cellpadding=""0"" cellspacing=""0"" width=""100%"">
                                <tr>
                                    <td width=""28"">
                                    </td>
                                    <td width=""544"" height=""96"" style=""border-bottom:1px solid #cccccc;"">
                                    </td>
                                    <td width=""28"">
                                    </td>
                                </tr>
                            </table>
                        </td>
                        <td></td>
                    </tr>
                    <tr>
                        <td height=""28""></td>
                    </tr>
                    <tr>
                        <td></td>
                        <td width=""600"" style=""
                        font-size: 16px;
                        line-height: 24px;
                        font-style: italic;
                        margin-top:30px;mso-line-height-rule:exactly;"">
                            The Shoutouts app allows you to recognize and appreciate your peers across the company. Try it today! Download and install the PowerApps player from your app store.
                        </td>
                        <td></td>
                    </tr>
                </table>
            </td>
        </tr>
    </table>
</body>

</html>"
}));
If(Not(UploadedImage1.Image = SampleImage),
    Office365.SendEmail(UserSelectedMail & ";" & Office365Users.Manager(UserSelectedPrincipalName).Mail, "Shoutout!", emailHtml,{IsHtml:true,Attachments:Table({Name:"ShoutoutAttachment.jpg", ContentBytes:UploadedImage1.Image, '@odata.type':""}),
     Importance:"normal"}),
     Office365.SendEmail(UserSelectedMail & ";" & Office365Users.Manager(UserSelectedPrincipalName).Mail, "Shoutout!", emailHtml, {IsHtml:true, Importance:"normal"}));
UpdateContext({emailHtml:""});
Navigate(SentConfirmationScreen,None)

Capture.PNG

If you do not want to send the email, you could delet the below part of the formula

If(
Office365.SendEmail(UserSelectedMail & ";" & Office365Users.Manager(UserSelectedPrincipalName).Mail, "Shoutout!", emailHtml,{IsHtml:true,Attachments:Table({Name:"ShoutoutAttachment.jpg", ContentBytes:UploadedImage1.Image, '@odata.type':""}),
Importance:"normal"}),
Office365.SendEmail(UserSelectedMail & ";" & Office365Users.Manager(UserSelectedPrincipalName).Mail, "Shoutout!", emailHtml, {IsHtml:true, Importance:"normal"}));
UpdateContext({emailHtml:""})

 

Please go ahead and have a try.

 

Regards,

Mona

Community Support Team _ Mona Li
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
drewski
Level: Powered On

Re: Accessing associated Flow(s) from Template Apps

Knew i was forgetting something - that Office365.SendEmail function. Thank you! I'll give that a shot