Skip to main content

Notifications

Power Apps - Building Power Apps
Answered

PowerAppV2 to Email using power automate but roadblock

(0) ShareShare
ReportReport
Posted on by 21

Background: Multi screen, multi form app, confirm accuracy screen, final submit button. 

Expectation: Final submit button creates an email with all the listed fields to be sent to the app user and their manager. 

Current reality: Error showing on button but no suggestions as to how to fix. Ran with an outside user today and couldn't get to final submission review screen. I don't what parameters it is requesting for the email as I have tried the suggested format and several others with no success.

Here's the code for final submit of OnSuccess: 

If(
IsEmpty(Errors('Incident Investigation Tracker')),
IncidentNotificationResponse.Run(Office365Outlook.SendEmail(to: "" & ()User.email),Office365Outlook.SendEmail(subject: "Incident Notification"),
NotificationType.Success
);
Navigate('48hr');
Notify(
First(Errors('Incident Investigation Tracker')).Message,
NotificationType.Error
)

 

CBlasius_0-1695840247568.png

 

I've been working on this app for six weeks and can't seem to get beyond this point. 

From here I want the information to auto generate a form in a sharepoint list from the info entered in the app. 

  • BCBuizer Profile Picture
    BCBuizer 21,809 on at
    Re: PowerAppV2 to Email using power automate but roadblock

    Hi @CBlasius ,

     

    The $ is actually a string interpolation operator that is key to making this work, so don't delete it.

     

    Instead, focus on making the formulas in the the curly braces work which is what I was referring to when I mentioned making corrections for wrong column names and types.

    First, make sure all column names are correct. After that, if you still have errors, you need to select the columns of any complex column types (Choice, LookUp, Person, etc.).

  • CBlasius Profile Picture
    CBlasius 21 on at
    Re: PowerAppV2 to Email using power automate but roadblock

    This definitely created an email with the removal of the $ and updating the URL. On with my debugging process! Thank you! 

  • Verified answer
    BCBuizer Profile Picture
    BCBuizer 21,809 on at
    Re: PowerAppV2 to Email using power automate but roadblock

    Hi @CBlasius ,

     

    Personally I'd go with the option to send the mail directly from the app which should look something like this:

    If(
    	IsEmpty(Errors('Incident Investigation Tracker')),
    	Office365Outlook.SendEmailV2(
    		User().Email,
    		$"Incident Notification: {Self.LastSubmit.Title} {Self.LastSubmit.ReportType}",
    		$"Thank you for submitting your notification, please see below: <br>
    		Incident Title: {Self.LastSubmit.Title} <br>
    		Report Type: {Self.LastSubmit.ReportType} <br>
    		Track Owner: {Self.LastSubmit.TrackOwner} <br>
    		Department: {Self.LastSubmit.Department} <br>
    		Type of On-Track equipment involved: {Self.LastSubmit.OTE} <br>
    		City: {Self.LastSubmit.City} <br>
    		State: {Self.LastSubmit.State} <br>
    		Milepost: {Self.LastSubmit.Milepost} <br>
    		Incident Narrative: {Self.LastSubmit.Narrative} <br>
    		<br>
    		This notification has initiated an NPRC 7000 form associated with this incident. Your NPRC 7000 form may be missing data if it was not available when you started this app.<br>
    		<br>
    		For more documents, please visit the <a href=""URL1"">Safety Incident Investigation</a> page by <a href=""URL1"">Clicking here</a>."
    	);
    	Notify(
    		"Your incident was succesfully reported", 
    		NotificationType.Success
    	),
    	Navigate('48hr');
    	Notify(
    		First(Errors('Incident Investigation Tracker')).Message,
    		NotificationType.Error
    	)
    )

     

    In the above you'll need to probably still make some corrections as column names and types don't match. Also you need to replace URL1 with the actual link of the Safety Incident Investigation page.

  • ANB Profile Picture
    ANB 7,060 on at
    Re: PowerAppV2 to Email using power automate but roadblock

    HI @CBlasius , You have 6 input parameter for your flow. I would suggest to check this video: https://www.youtube.com/watch?v=teJgN9QjBwM

     

    ------------------------------------------------------------------------------------------------------------------------------

    I hope this helps.

    Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs up.

    Thanks,
    ANB

  • CBlasius Profile Picture
    CBlasius 21 on at
    Re: PowerAppV2 to Email using power automate but roadblock

    CBlasius_0-1695843082686.png

     

  • ANB Profile Picture
    ANB 7,060 on at
    Re: PowerAppV2 to Email using power automate but roadblock

    Hi @CBlasius , I was looking for the trigger screenshot, not the action. Below 

     

    ANB_4-1695842949931.png

     

    Thanks,

    ANB

     

  • CBlasius Profile Picture
    CBlasius 21 on at
    Re: PowerAppV2 to Email using power automate but roadblock

    Here's the email set up: 

    CBlasius_0-1695842311154.png

     

  • ANB Profile Picture
    ANB 7,060 on at
    Re: PowerAppV2 to Email using power automate but roadblock

    Hi @CBlasius ,  As said the input parameter of your flow couldn't be the Office365Outlook.SendEmail(). As the current screenshot, it seems that you require 3 input parameters, so can you please share the screenshot of your Power Automate flow trigger?

    OR

    Can you confirm that the first parameter of your flow is useremail
    2nd parameter is IncidentTitle and 3rd is Report Type?

    If yes, then the code should be as follow:

    IncidentNotificationResponse.Run(EMAILADDRESOFUSER, INCIDENTTITLE, REPORTTYPE)

     

    These 3 parameter you need to pass in same sequence the way it is declared in PowerApps (V2) trigger.

     

    ------------------------------------------------------------------------------------------------------------------------------

    I hope this helps.

    Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs up.

    Thanks,
    ANB

     

     

  • CBlasius Profile Picture
    CBlasius 21 on at
    Re: PowerAppV2 to Email using power automate but roadblock

    The app entries are going to a Sharepoint list and limited fields need to go to the original user and their manager. Which way is the best way to configure that? 

  • CBlasius Profile Picture
    CBlasius 21 on at
    Re: PowerAppV2 to Email using power automate but roadblock

    Thank you for responding so quickly. Like I said, I have tried several different ways to try to get this to work including office as listed, the automate which asked for four fields but I want 11 to show. 

    CBlasius_0-1695841624870.png

    Hopefully this is what you were requesting. 

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

Microsoft Kickstarter Events…

Register for Microsoft Kickstarter Events…

Announcing Our 2025 Season 1 Super Users!

A new season of Super Users has arrived, and we are so grateful for the daily…

Announcing Forum Attachment Improvements!

We're excited to announce that attachments for replies in forums and improved…

Leaderboard

#1
WarrenBelz Profile Picture

WarrenBelz 145,475

#2
RandyHayes Profile Picture

RandyHayes 76,287

#3
Pstork1 Profile Picture

Pstork1 64,767

Leaderboard