cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
PhilatBaker
Level 8

Activating a FLOW and Patch command on the same submit button

This may be an easy question but I have an App that upon OnSelect (or "Submit" button) it sends information to a SharePoint list via a Patch command.  I also have it clear the forms and navigate to a home page.

 

I want to add a FLOW to this patch, what command would I after the patch?  Or is there an easier or better way to do it?

 

 

Here is a copy of my Patch command:

 

Patch('Incident Overview',Defaults('Incident Overview'),
{
incidenttype: DataCardValue23.Selected,
employeefullname: DataCardValue7.Selected,
Job_x0020_Name: DataCardValue45_1.Text,
Job_x0020_Number: DataCardValue46_1.Text,
Department: DataCardValue47_1.Text,
Incident_x0020_Date: DataCardValue21.SelectedDate,
Incident_x0020_on_x0020_Jobsite_: If(DataCardValue2.Selected.Value = "Yes",true,false),
Incident_x0020_Description: DataCardValue26.Text,
Describe_x0020_Next_x0020_Steps: DataCardValue64_4.Text
});
ResetForm(Form2_2);ResetForm(Form2_42);
Refresh('Incident Overview');
Navigate('Thank You', ScreenTransition.Fade)

1 ACCEPTED SOLUTION

Accepted Solutions
Community Support Team
Community Support Team

Re: Activating a FLOW and Patch command on the same submit button

Hi @PhilatBaker,

 

Do you want to trigger a flow when you click (or tap) the "Submit" button?

 

If you want to trigger a flow when you click (or tap) the "Submit" button, please take a try with the following workaround:

  1. Cut ("Ctrl + X") the Patch command that you provided from the OnSelect property of the "Submit" button.
  2. Select the "Submit" button, then click Action tab in top menu -> click the Flows option. Within right pop-up panel, select one flow you want to trigger.
  3. Within OnSelect property, provided parameters (if required) for 'YourFlowName'.Run function.
  4. Paste ("Ctrl + V") the Patch command that you cut in Step1 before the 'YourFlowName'.Run function, The Patch command and the 'YourFlowName'.Run function is separated using semicolon (;).

The GIF image as below:Test1.gif

 

On your side, the OnSelect property of your "Submit" button should be set to following formula:

Patch('Incident Overview',Defaults('Incident Overview'),
{
incidenttype: DataCardValue23.Selected,
employeefullname: DataCardValue7.Selected,
Job_x0020_Name: DataCardValue45_1.Text,
Job_x0020_Number: DataCardValue46_1.Text,
Department: DataCardValue47_1.Text,
Incident_x0020_Date: DataCardValue21.SelectedDate,
Incident_x0020_on_x0020_Jobsite_: If(DataCardValue2.Selected.Value = "Yes",true,false), 
Incident_x0020_Description: DataCardValue26.Text,
Describe_x0020_Next_x0020_Steps: DataCardValue64_4.Text
});
ResetForm(Form2_2);ResetForm(Form2_42);
Refresh('Incident Overview');
Navigate('Thank You', ScreenTransition.Fade);
'YourFlowName'.Run()

More details about starting a flow from a PowerApps app, please check the following article:

Start a flow from an app

 

 

Best regards,

Kris

Community Support Team _ Kris Dai
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
5 REPLIES 5
Community Support Team
Community Support Team

Re: Activating a FLOW and Patch command on the same submit button

Hi @PhilatBaker,

 

Do you want to trigger a flow when you click (or tap) the "Submit" button?

 

If you want to trigger a flow when you click (or tap) the "Submit" button, please take a try with the following workaround:

  1. Cut ("Ctrl + X") the Patch command that you provided from the OnSelect property of the "Submit" button.
  2. Select the "Submit" button, then click Action tab in top menu -> click the Flows option. Within right pop-up panel, select one flow you want to trigger.
  3. Within OnSelect property, provided parameters (if required) for 'YourFlowName'.Run function.
  4. Paste ("Ctrl + V") the Patch command that you cut in Step1 before the 'YourFlowName'.Run function, The Patch command and the 'YourFlowName'.Run function is separated using semicolon (;).

The GIF image as below:Test1.gif

 

On your side, the OnSelect property of your "Submit" button should be set to following formula:

Patch('Incident Overview',Defaults('Incident Overview'),
{
incidenttype: DataCardValue23.Selected,
employeefullname: DataCardValue7.Selected,
Job_x0020_Name: DataCardValue45_1.Text,
Job_x0020_Number: DataCardValue46_1.Text,
Department: DataCardValue47_1.Text,
Incident_x0020_Date: DataCardValue21.SelectedDate,
Incident_x0020_on_x0020_Jobsite_: If(DataCardValue2.Selected.Value = "Yes",true,false), 
Incident_x0020_Description: DataCardValue26.Text,
Describe_x0020_Next_x0020_Steps: DataCardValue64_4.Text
});
ResetForm(Form2_2);ResetForm(Form2_42);
Refresh('Incident Overview');
Navigate('Thank You', ScreenTransition.Fade);
'YourFlowName'.Run()

More details about starting a flow from a PowerApps app, please check the following article:

Start a flow from an app

 

 

Best regards,

Kris

Community Support Team _ Kris Dai
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
PhilatBaker
Level 8

Re: Activating a FLOW and Patch command on the same submit button

Perfect

mr-dang
Level 10

Re: Activating a FLOW and Patch command on the same submit button

That is a thorough solution from @v-xida-msft--kudos on a good job!

 

Adding onto that, actions that you want to proceed in a precise order will use a semicolon (Smiley Wink, but if you have other actions you'd like run in parallel (not in this case), then you can try the new Concurrent() function:

 

https://powerapps.microsoft.com/en-us/blog/enjoy-faster-startup-times-with-the-new-concurrent-functi...

 

Mr. Dang

Microsoft Employee
@8bitclassroom
PhilatBaker
Level 8

Re: Activating a FLOW and Patch command on the same submit button

Wow, this is new to me.  I am definitely going to try this out.

Super User
Super User

Re: Activating a FLOW and Patch command on the same submit button

@mr-dang - thanks for pointing out the new concurrent command - excellent improvement over the prior workaround of attaching commands to multiple timers Smiley Happy 

Time to go back and rework some old apps!

Helpful resources

Announcements
firstImage

Watch Sessions On Demand!

Continue your learning in our online communities.

Power Platform 2019 release wave 2 plan

Power Platform 2019 release wave 2 plan

Features releasing from October 2019 through March 2020

FirstImage

Power Platform World Tour

Coming to a city near you

thirdimage

PowerApps Community User Group Member Badge

Fill out a quick form to claim your user group badge now!

FourthImage

Join PowerApps User Group!!

Connect, share, and learn with your peers year-round

SecondImage

Power Platform Summit North America

Register by September 5 to save $200

Users Online
Currently online: 105 members 4,744 guests
Please welcome our newest community members: