cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
ppl
Post Patron
Post Patron

Sending email to Created By person

Hello.

My app connected with SharePoint list. And I want to make a button in ItemDetails screen which will send email to person who create an item in this list. I am trying to use  Office365Outlook.SendEmail function, but it returns an error that created by is a text, not email. How I may get Email of person who create an item to put this email in my function?

Annotation 2020-04-15 115023.png

Office365Outlook.SendEmail(
    DataCardValue17,
    "Subject",
    "EmailBody"
);

Annotation 2020-04-15 115604.png

2 ACCEPTED SOLUTIONS

Accepted Solutions
WarrenBelz
Super User
Super User

Hi @ppl ,

You can use 

ThisItem.'Created By'.Email

to reference the person who created it from within the gallery or form OR

YourGalleryName.Selected.'Created By'.Email

If selected from a gallery.

 

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.

View solution in original post

@ppl ,

Sorry, danger of free-typing - code should be

If(
   !IsBlank(
      Param("ItemId")
   ),
   Set(
      vID,
      Value(Param("ItemId"))
   )
)

 

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.

View solution in original post

29 REPLIES 29
GarethPrisk
Resident Rockstar
Resident Rockstar

You'll need to dig a layer deeper into the DataCardValue17 control, to access the property which has the value shown. This will vary from control to control - like .Value, .Text, .SelectedItem, etc.

 

In your case, if that's a Text column, then trying appending .Text

Office365Outlook.SendEmail(
    DataCardValue17.Text,
    "Subject",
    "EmailBody"
);

 These are often referred to as control Core Properties, BTW.

WarrenBelz
Super User
Super User

Hi @ppl ,

You can use 

ThisItem.'Created By'.Email

to reference the person who created it from within the gallery or form OR

YourGalleryName.Selected.'Created By'.Email

If selected from a gallery.

 

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.

Thank you very much!

It works

GalleryName.Selected.'Created By'.Email

 

I accepted solution too fast.

It has some problems) there is no errors, but it sending email not to Created By person. Email is sending to person who editing item now and press this button.

@ppl ,

Very strange - I just put a label in a gallery with ThisItem.'Created By'.Email and got all the correct email addresses.

You should be getting the correct result as this function is designed to give this information.

Are you following this exact syntax?

@WarrenBelz,

No, I have used 

GalleryName.Selected.'Created By'.Email

If I use ThisItem.'Created By'.Email  I get an error

Untitled.png

@ppl ,

That is why I gave you the two syntaxes. ThisItem will only work inside a form or a gallery (when you can refer directly to the chosen record.

Try putting a label in any card in your record with this syntax and I believe you should receive the correct information.

 

@WarrenBelz,

But it is right in DetailScreen Form. It is the screen when I get after I choose an item from the gallery.

Screenshot 2020-04-16 06.02.49.png

@ppl ,

I can guarantee you it may be ON the form (in its placement on the screen), but it is not IN the form as being inserted into one of the DataCards). Unlock a card, highlight it and insert a button. Make sure after this it cannot move outside the card and then put the code in - it will work.

ButtonInForm.png

 

Helpful resources

Announcements
Power Apps News & Annoucements carousel

Power Apps News & Announcements

Keep up to date with current events and community announcements in the Power Apps community.

Community Call Conversations

Introducing the Community Calls Conversations

A great place where you can stay up to date with community calls and interact with the speakers.

Power Apps Community Blog Carousel

Power Apps Community Blog

Check out the latest Community Blog from the community!

Top Solution Authors
Top Kudoed Authors
Users online (6,024)