Skip to main content

Notifications

Power Apps - Building Power Apps
Suggested answer

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

Like (2) ShareShare
ReportReport
Posted on 12 Sep 2024 08:59:46 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 222 on 13 Sep 2024 at 09:11:02
    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 13 Sep 2024 at 02:15:16
    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 29,371 on 12 Sep 2024 at 19:59:42
    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 1,545 on 12 Sep 2024 at 15:29:22
    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

November 2024 Newsletter…

November 2024 Community Newsletter…

Community Update Oct 28…

Power Platform Community Update…

Tuesday Tip #9 Get Recognized…

Welcome to a brand new series, Tuesday Tips…

Leaderboard

#1
WarrenBelz Profile Picture

WarrenBelz 144,479

#2
RandyHayes Profile Picture

RandyHayes 76,308

#3
Pstork1 Profile Picture

Pstork1 64,350

Leaderboard
Loading started