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

Click a PowerApps Button to use Microsoft Flow to send an email about information about 1 single SharePoint item

Hi PowerApps Users,

 

I have created a PowerApps but now I am trying to add a feature such that when I click a button, Microsoft flow gets a single item data from my SharePoint List and sends that information to me via Outlook. The issue I am facing is I am not sure what is the formula I need to enter to key into the OnSelect of the button to retrieve information for the particular item from SharePoint.

 

Thanks in advanced for any help!

 

1.JPG2.JPG

1 ACCEPTED SOLUTION

Accepted Solutions
Community Support
Community Support

Re: Click a PowerApps Button to use Microsoft Flow to send an email about information about 1 single SharePoint item

Hi @TravisJohanly,

 

Why is the button inside the Enter By Data Card?

I think @mdevaney is right, if you want to submit the form and pass the ID of just submitted item to flow, please go to delete the Button, then set the OnSuccess property of EditForm to test.Run(EditForm1.LastSubmit.ID)

There shouldn't be any error messages for this code.

Could you please have a try and check if this works for your case?

Sik

 

View solution in original post

23 REPLIES 23
Super User
Super User

Re: Click a PowerApps Button to use Microsoft Flow to send an email about information about 1 single SharePoint item

@TravisJohanly

In your Flow it appears you are passing the ID to PowerApps.

Put your code in the OnSuccess property of the form, not the OnSelect of the button.

test.Run(EditForm1.LastSubmit.ID)

 

---
Please click "Accept as Solution" if my post answered your question so that others may find it more quickly. If you found this post helpful consider giving it a "Thumbs Up."

 

TravisJohanly Helper I
Helper I

Re: Click a PowerApps Button to use Microsoft Flow to send an email about information about 1 single SharePoint item

Hi @mdevaney  ,

 

I have tried putting the code in OnSuccess of the form but the button remains in error. The error in the button is "Invalid number of arguments: Expected 1 received 0". 

3.JPG

Super User
Super User

Re: Click a PowerApps Button to use Microsoft Flow to send an email about information about 1 single SharePoint item

@TravisJohanly 

I assume the purpose of your button is to Submit the form.  Therefore, delete any code in the button and write

SubmitForm(EditForm1);

 

---
Please click "Accept as Solution" if my post answered your question so that others may find it more quickly. If you found this post helpful consider giving it a "Thumbs Up." 

TravisJohanly Helper I
Helper I

Re: Click a PowerApps Button to use Microsoft Flow to send an email about information about 1 single SharePoint item

Hi @mdevaney The purpose of the button is a trigger for a sharepoint item's information to be emailed to myself. 

Super User
Super User

Re: Click a PowerApps Button to use Microsoft Flow to send an email about information about 1 single SharePoint item

@TravisJohanly 

If the purpose of your button is not to submit anything...  add the ID field to your EditForm1.

 

Then change the Visible property for DataCard for EditForm1 to this code

false

 

And put this code in the OnSelect property of your button (with the your own fieldname)

test.Run(Value(DataCardValue_ID.Text))

 

---
Please click "Accept as Solution" if my post answered your question so that others may find it more quickly. If you found this post helpful consider giving it a "Thumbs Up."

TravisJohanly Helper I
Helper I

Re: Click a PowerApps Button to use Microsoft Flow to send an email about information about 1 single SharePoint item

Hi @mdevaney  i have used the code on onselect for the button but what do you mean ID for form?4.JPG

Super User
Super User

Re: Click a PowerApps Button to use Microsoft Flow to send an email about information about 1 single SharePoint item

@TravisJohanly
You need to reference the field that shows the SharePoint ID since you are requiring it in Flow.
TravisJohanly Helper I
Helper I

Re: Click a PowerApps Button to use Microsoft Flow to send an email about information about 1 single SharePoint item

Hi @mdevaney can you please advice how should I do that? 

JPdarling9 Helper I
Helper I

Re: Click a PowerApps Button to use Microsoft Flow to send an email about information about 1 single SharePoint item

To get the right ID passed to flow, try selecting your form, take a look at how you pass the record to the form for editing it.

You can then pass the ID of that value by just appending a ‘.ID’ to the end of that record and that should work.

As a note, if you are trying to do this for a new record that hasn’t been created in SharePoint yet, then consider triggering this action after the SubmitForm function. This would be using the LastSubmit that has been previously mentioned.

Helpful resources

Announcements
MBAS Gallery 2020

MBAS Gallery 2020

Watch Microsoft Business Applications Summit sessions on-demand.

firstImage

New Ranks and Rank Icons released on April 21!

The time has come: We are finally able to share more details on the brand-new ranks coming to the Power Apps Community!

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