Skip to main content

Notifications

Power Platform Community / Forums / Building Power Apps / App Fails to Send Emai...
Building Power Apps
Suggested answer

App Fails to Send Emails After First Submission When Published, But Works in Play Mode

Posted on by 40
I’ve built a Power Apps form that retrieves email addresses using LookUp from a SharePoint list called 'Approval Matrix' for sending emails upon submission. The app works perfectly in play mode (when testing in Power Apps Studio). However, after publishing the app and using it live, the first form submission fails to send emails, showing that the email receiver is empty.
 
the code I’ve implemented for handling email notifications in our Power Apps application: Formulas:
FirstApprover = LookUp('Approval Matrix', Section = DataCardValue17_1.Selected.Value, 'First Approver Email');
SecondApprover = LookUp('Approval Matrix', Title = DataCardValue5_1.Selected.Value && Section = DataCardValue17_1.Selected.Value, 'Second Approver Email');
 
Email Logic in App OnStart Property:
Switch(
  
    Lower(User().Email),
   
    Lower(FirstApprover),
    Office365Outlook.SendEmailV2(
        SecondApprover,
        " Request for New member",
        "etc..."
    ),
  
    Lower(SecondApprover),
    Office365Outlook.SendEmailV2(
        "manager's email"//
      
    ),
    // Default case:
    Office365Outlook.SendEmailV2(
        FirstApprover,    
        "Request ",
       
    )
)

Please let me know if there are any suggestions or improvements you would recommend. Your feedback would be greatly appreciated.

Thank you!

  • Suggested answer
    CA1105 Profile Picture
    CA1105 182 on at
    App Fails to Send Emails After First Submission When Published, But Works in Play Mode
    What is the problem with end users? Are they facing any issue or error? Can you check permission over Datasource for your users if they have proper access on your Approval Matrix table or not.
  • htet-htet Profile Picture
    htet-htet 40 on at
    App Fails to Send Emails After First Submission When Published, But Works in Play Mode
    Re @FLMike it doesn't work for everyone
  • Suggested answer
    FLMike Profile Picture
    FLMike 26,301 on at
    App Fails to Send Emails After First Submission When Published, But Works in Play Mode
    Hi
     
    When you say it works in play mode that means you, the developer who is probably an admin too
     
    So are you referring to yourself it doesn't work for, or for others, for whom they may not have privileges?
  • Nandit Profile Picture
    Nandit 752 on at
    App Fails to Send Emails After First Submission When Published, But Works in Play Mode
     
    It would be helpful if you could share the code you are using too. 
     
    Kind regards, 
    Nandit

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

September 2024 Newsletter…

September 2024 Community Newsletter…

Community Update Sept 16…

Power Platform Community Update…

Welcome to the new Power Platform Community!…

We are excited to announce our new Copilot Cookbook Gallery in the Community…

Leaderboard

#1
WarrenBelz Profile Picture

WarrenBelz 141,122

#2
RandyHayes Profile Picture

RandyHayes 76,308

#3
Pstork1 Profile Picture

Pstork1 63,414

Leaderboard