cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
Helper II
Helper II

Send Email as well as send data to Excel

Thanks to this forum my very first app is nearly ready for people to test, the only thing left is to be able to send the data in a form in a calander request to someone.  I've had a look at sending emails via Flows but it never seems to send or I dont have the options when I try to create the Flow.

 

Firstly is being able to send email/calander requests in a PowerApp only available if you use Flows or is it even possible to send an email with only using PowerApps.  The data that I want to send will be in the form that I'm clicking to create a ticket.. 

 

Kind Regards

James

1 ACCEPTED SOLUTION

Accepted Solutions
Highlighted
Power Participant
Power Participant

Re: Send Email as well as send data to Excel

As the Help says, the parameters for SendEmail are: Office365.SendEmail(adress, topic, body), all strings

 

In my example, ThisItem.BestEPost refers to a field with the email address I want to send the email to

 

"Din beställning till IT-avdelningen har behandlats" is the topic

 

The next parameter is a concatenation of the body: First I have some initial text, then I add a field (using the &-operator), some more text, the name of the user, a new line, some more text and two more new lines. Then it gets interesting - by using Concat I loop through a gallery (gOnskeRader.AllItems) and add fields from each row in the gallery to the body of the email.

 

At the very end I add two more blank lines and a greeting to top things off.

 

"Beställningen du skickade " & ThisItem.Bestallningsdatum & " har nu blivit inlagd i beställningslistan av " & User().FullName & "." & Char(13) & "Du beställde:" & Char(13) & Char(13) & Concat(gOnskeRader.AllItems; Anvandare & " " & Avdelning_Plats & " " & Benamning & " " & Antal & Char(13)) & Char(13) & "Mvh" & Char(13) & "IT-avdelningen"

 

So, in the topic or body (or both), you just have to string together what you want the topic/body to say.

 

NB - You might run into trouble just referencing the Datacard, fopr instance DataCardValue21. Instead it might be better to reference the vaue of the datacard, DataCardValue21.Value as has been reported elsewhere.

 

Good luck!

View solution in original post

5 REPLIES 5
Highlighted
Power Participant
Power Participant

Re: Send Email as well as send data to Excel

It is very doable to send an email from within PA. I have done that, but not a calendar request. You send an email by using the Office365.SendEmail function and you can use fields from your gallery or collection, see my example below:

 

Office365.SendEmail(ThisItem.BestEpost; "Din beställning till IT-avdelningen har behandlats"; "Beställningen du skickade " & ThisItem.Bestallningsdatum & " har nu blivit inlagd i beställningslistan av " & User().FullName & "." & Char(13) & "Du beställde:" & Char(13) & Char(13) & Concat(gOnskeRader.AllItems; Anvandare & " " & Avdelning_Plats & " " & Benamning & " " & Antal & Char(13)) & Char(13) & "Mvh" & Char(13) & "IT-avdelningen")

I use the function Concat to loop through a gallery to add information for each row and Char(13) to force a new line.

 

The Office365 object also has a function called CalendarPostItem, but the guide, found here https://powerapps.microsoft.com/en-us/tutorials/connection-office365-outlook/, doesn't give any details as to how to use it. Maybe that's a possibility, but you'd have to do a bit of research on how to use it.

 

Best of luck!

 

EDIT - I found a link to a discussion about the CalendarPostItem here: https://community.powerapps.com/t5/PowerApps-Forum/Writing-an-Event-to-Outlook-Calendar/m-p/51818

Highlighted
Helper II
Helper II

Re: Send Email as well as send data to Excel

Hi there,

 

Many thanks for the info I've been playing around and I've got the standard parts setup for a basic form :-

 

Office365.SendEmail(DataCardValue19, DataCardValue20, DataCardValue21); ResetForm(Form1)

 

That returns the correct information so far, but I've got more fields and I can't work out how to add those fields to the email?  

 

Within your example :-

 

Office365.SendEmail(ThisItem.BestEpost;

 

What is this doing and what information do I need to put there in my line?

 

Any help most welcome 🙂

Highlighted
Power Participant
Power Participant

Re: Send Email as well as send data to Excel

As the Help says, the parameters for SendEmail are: Office365.SendEmail(adress, topic, body), all strings

 

In my example, ThisItem.BestEPost refers to a field with the email address I want to send the email to

 

"Din beställning till IT-avdelningen har behandlats" is the topic

 

The next parameter is a concatenation of the body: First I have some initial text, then I add a field (using the &-operator), some more text, the name of the user, a new line, some more text and two more new lines. Then it gets interesting - by using Concat I loop through a gallery (gOnskeRader.AllItems) and add fields from each row in the gallery to the body of the email.

 

At the very end I add two more blank lines and a greeting to top things off.

 

"Beställningen du skickade " & ThisItem.Bestallningsdatum & " har nu blivit inlagd i beställningslistan av " & User().FullName & "." & Char(13) & "Du beställde:" & Char(13) & Char(13) & Concat(gOnskeRader.AllItems; Anvandare & " " & Avdelning_Plats & " " & Benamning & " " & Antal & Char(13)) & Char(13) & "Mvh" & Char(13) & "IT-avdelningen"

 

So, in the topic or body (or both), you just have to string together what you want the topic/body to say.

 

NB - You might run into trouble just referencing the Datacard, fopr instance DataCardValue21. Instead it might be better to reference the vaue of the datacard, DataCardValue21.Value as has been reported elsewhere.

 

Good luck!

View solution in original post

Highlighted
Helper II
Helper II

Re: Send Email as well as send data to Excel

Many thanks for the input it seems to work like a charm via email... now onto the Calendar 🙂

Highlighted
Power Participant
Power Participant

Re: Send Email as well as send data to Excel

Glad I could help, @JamesOxton!

 

Good luck with the calendar, I haven't used it yet! If you find a solution, post it here!

Helpful resources

Announcements
August 2020 Community Challenge: Can You Solve These?

August 2020 Community Challenge: Can You Solve These?

We're excited to announce our first cross-community 'Can You Solve These?' challenge!

secondImage

Return to Workplace

Reopen responsibly, monitor intelligently, and protect continuously with solutions for a safer work environment.

secondImage

Super Users Coming in August

We are excited for the next Super User season.

secondImage

Community User Group Member Badges

FIll out a quick form to claim your community user group member badge today!

secondImage

Power Platform 2020 release wave 2 plan

Features releasing from October 2020 through March 2021

Top Solution Authors
Top Kudoed Authors
Users online (7,116)