cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Veblitz
Post Prodigy
Post Prodigy

Dynamic parameters in button click ask powerapps when item created in editform

Please help me how to pass the dynamic parameters for sending email to SharePoint approvers list when item created in SharePoint list using edit form and while clicking submit button item getting created and I got to trigger email from MS flow and refer the blow steps and refer below Approver list details for the same.

 

Kindly revert incase of any details. Thanks in advance.

Veblitz_1-1669734163194.png

 

Veblitz_1-1669733363185.png

 

 

 

 

Background:

Email trigger to below users from SharePoint Approvers list Title=HR

Veblitz_1-1669733363185.png

 

Flow steps:

 

Veblitz_0-1669733270216.png

 

Veblitz_2-1669733399693.png

Veblitz_3-1669733445212.png

 

 

 

Veblitz_1-1669730194737.png

 

Veblitz_4-1669733510677.png

 

Importantly, To field  email address should be coming from SharePoint configuration list Approvers

Veblitz_2-1669730289606.png

 

1 ACCEPTED SOLUTION

Accepted Solutions
SebS
Memorable Member
Memorable Member

@Veblitz 

 

Go back to Your original list for approvers and all should work the code with Concat + lookup will do the job

i notice there is and issue how You created emailaddresses if you done that table and this column this way you will not need to concat anything concat is to add separate records together by ";" if there are not in same cell so if you placed two emails in one cell this is not required


If you like this post, give a Thumbs up. Where it solved your request, Mark it as a Solution to enable other users to find it.

View solution in original post

23 REPLIES 23
SebS
Memorable Member
Memorable Member

Hi @Veblitz 

 

EditForm have a property called LastSubmited You can use this to retrieve last ID and for the email just use User().Email

 

"Flow".Run(User().Email, EditForm1.LastSubmit.ID)

 

make sure it's starts flow OnSuccess to avoid running flow when something goes wrong

 

Here are more details about the properties of the EditForm


If you like this post, give a Thumbs up. Where it solved your request, Mark it as a Solution to enable other users to find it.

Thanks for your inputs

 

do we need to write the formula in onsuccess property but not in button click since to prevent the flow if any errors in the form so in that context we got to run the flow in editform onsuccess property right?

"Flow".Run(User().Email, EditForm1.LastSubmit.ID)

 

Then I also need to trigger email for users who are in approvers SharePoint list Title is "HR" and please let me know how to check that condition

SebS
Memorable Member
Memorable Member

You can Create a collection :

 

Collect(HR_Mail,
               Filter("HR List",
                 Title = "HR")
)

 

Then depend if You need the user Email You are leaving User().Email add another Variable to the flow Text called HRMail at the end, then add in the Formula additional code that will pull emails from the collection

 

"Flow".Run(User().Email, EditForm1.LastSubmit.ID,Concat(HR_Email,Email,";"))

 

And put whole this code into OnSuccess

 

Collect(HR_Mail,
               Filter("HR List",
                 Title = "HR")
);

"Flow".Run(User().Email, EditForm1.LastSubmit.ID,Concat(HR_Email,Email,";"))

 

Keep in mind I assume under HR List You have more than 1 email if there is one just use lookup, but the filter will do the same thing

 

In this Scenario, the Title column contains Role Name Like HR and Column with Email Addresses is called Email


If you like this post, give a Thumbs up. Where it solved your request, Mark it as a Solution to enable other users to find it.
Veblitz
Post Prodigy
Post Prodigy

Thanks for your inputs and i would test the same and keep you posted if its done.

Much appreciated

 

I tried adding the above formula but I'm getting few errors in the onsuccess property of my editform 

 

Also, IN my MS flow steps i created email variable to fetch values from PowerApps dynamically and let me know if i got to alter anything in overall context or revert incase of any issues.

 

Flow background: Im getting the item ID post editform submission and updating the status in list1  and sending email to approvers list in my case .Please review the flows for overall idea and the list configuration settings.

 

Thanks in advance. 

 

Flow steps

Veblitz_2-1669817091656.png

Veblitz_3-1669817194760.png

Veblitz_4-1669817316924.png

Veblitz_5-1669817350720.png

 

 

 

Veblitz_0-1669816825598.png

Veblitz_1-1669816926749.png

 

SebS
Memorable Member
Memorable Member

You only have two Variable if the email You are passing is only the HR and You do not pass User Email just use this formula

 

"Flow".Run(Concat(HR_Email,Email,";"), EditForm1.LastSubmit.ID)

 

Other than That, You need to add another variable in your flow called for example HRMail

 


If you like this post, give a Thumbs up. Where it solved your request, Mark it as a Solution to enable other users to find it.
Veblitz
Post Prodigy
Post Prodigy

Thanks much,

 

Last but not least,Unfortunately, concat function returns invalid argument error type

 

I added a string variable in my flow as per below

Veblitz_0-1669818794414.png

 

 

but forumla returning errors in concat line ,function concat has some invalid arguments.Invalid argument type(Table) expecting a text value instead

 

Veblitz_1-1669819039962.png

 

SebS
Memorable Member
Memorable Member

@Veblitz 

 

the order is important and based in what order You created Variable on Your screen it's ID than Email in that case You need to use

 

"Flow".Run(EditForm1.LastSubmit.ID,Concat(HR_Email,Email,";"))

 

 


If you like this post, give a Thumbs up. Where it solved your request, Mark it as a Solution to enable other users to find it.
Veblitz
Post Prodigy
Post Prodigy

Many Thanks for valuable inputs!!! Much appreciated.

Though I passed as per flow order,its throwing error in concat line.

Unfortunately still my  formula returning errors in concat line ,function concat has some invalid arguments.Invalid argument type(Table) expecting a text value instead

 

Veblitz_0-1669820816197.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 (4,025)