cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
asdeev
Level: Powered On

Powerapp Forms - Help with editing form and submitting for approval

I have my Mobile app which is a form and my data source is from sql server.

 

I have a few questions:

Let me explain what Ia m doing first.

So first screen in the App has 2 buttons : 1. Create new work, 2. Edit new work. I am working on custom edit form for creating a new work order and when I click submit it should go to the manager for approval and also update in sql table. I tried writing my patch() which worked fine for a few fields I selected and submitted and i could see the data is stored in sql table.( FYI- this is what I did so far)

 

 

Now, 

 

1. I am not sure how to make this submit button work with flow in such a way that the manager can first approve and then the data should also be saved in the sql. Also once they submit I want the information to be cleared in the fields

 

2. To do editing to the already submitted form I created a new screen and inserted galary which has populated the forms I submitted for testing but I want to show only those forms that are belonged to that particular user.

 

3. When the user can see there forms and would like to edit something and resubmit it again I want my "Create form" (the first form) to be shown with all the information the user has submitted and also has the ability to add or remove anything they sbmitted already and resubmit for approval and add in database.

 

I have attached the pictures for better idea.

Can someone please help me with this.

1 ACCEPTED SOLUTION

Accepted Solutions
Community Support Team
Community Support Team

Re: Powerapp Forms - Help with editing form and submitting for approval

Hi @asdeev,

I have made a test on my side, please take a try with the following workaround:9.JPG

 

10.JPG

 

11.JPG

For your first question, do you want to click the "Submit"  button to fire/trigger a flow to send the approval email? If you want to click the "Submit" button to fire/trigger a flow to send the approval email, you must create your flow firstly. The flow's configuration as below:12.JPG

Then within your app, create a connection to above flow, then pass corresponding parameters to above flow from your app. Set the OnSelect property of the "Submit" button within your first form to following:

'YourFlowName'.Run(DataCardValue27.Text, DataCardValue34.Text, ...);
ResetForm(YourFirstForm)

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

Start a flow from an app

 

For your second question, if you only want show those forms that are belonged to the current login user, I think a Filter function could achieve your needs. I assume that you have create a column (e.g. SubmitterEmail) in your SQL TABLE to store the name or email address of the submitter, please set the Items property of the Gallery control to following formula:

Filter('[dbo].[JHA_APP]', SubmitterEmail = User().Email)  /* <-- SubmitterEmail represents a column in your SQL table to store the mail addredd of the submitter*/

For your third question, if you want to display the selected item in your Gallery within the Edit form control (your first form), please take a try with the following formula:

Set the OnSelect property of the Gallery control (Gallery1) to following:

Navigate(AddScreen,ScreenTransition.Cover) /* <-- AddScreen represents the screen which contains your first form */

Set the Item property of your first form ("Create form") to following:

Gallery1.Selected

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.

View solution in original post

2 REPLIES 2
Community Support Team
Community Support Team

Re: Powerapp Forms - Help with editing form and submitting for approval

Hi @asdeev,

I have made a test on my side, please take a try with the following workaround:9.JPG

 

10.JPG

 

11.JPG

For your first question, do you want to click the "Submit"  button to fire/trigger a flow to send the approval email? If you want to click the "Submit" button to fire/trigger a flow to send the approval email, you must create your flow firstly. The flow's configuration as below:12.JPG

Then within your app, create a connection to above flow, then pass corresponding parameters to above flow from your app. Set the OnSelect property of the "Submit" button within your first form to following:

'YourFlowName'.Run(DataCardValue27.Text, DataCardValue34.Text, ...);
ResetForm(YourFirstForm)

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

Start a flow from an app

 

For your second question, if you only want show those forms that are belonged to the current login user, I think a Filter function could achieve your needs. I assume that you have create a column (e.g. SubmitterEmail) in your SQL TABLE to store the name or email address of the submitter, please set the Items property of the Gallery control to following formula:

Filter('[dbo].[JHA_APP]', SubmitterEmail = User().Email)  /* <-- SubmitterEmail represents a column in your SQL table to store the mail addredd of the submitter*/

For your third question, if you want to display the selected item in your Gallery within the Edit form control (your first form), please take a try with the following formula:

Set the OnSelect property of the Gallery control (Gallery1) to following:

Navigate(AddScreen,ScreenTransition.Cover) /* <-- AddScreen represents the screen which contains your first form */

Set the Item property of your first form ("Create form") to following:

Gallery1.Selected

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.

View solution in original post

asdeev
Level: Powered On

Re: Powerapp Forms - Help with editing form and submitting for approval

Hi Kris,

 

Thanks so much for your help. I tried doing the same way you did for the approval flow. 

 

So once the data is stored in SQL I want the person who submitted the form to get an email informaing about the approval. To do that do I just add another condition in the flow? (After Starting Approval- If yes - Send email informing approval, if no- send email informing rejection)? Or should I create a whole new flow for this?

Helpful resources

Announcements
thirdimage

Power Automate Community User Group Member Badge

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

sixthImage

Power Platform World Tour

Find out where you can attend!

Power Platform 2019 release wave 2 plan

Power Platform 2019 release wave 2 plan

Features releasing from October 2019 through March 2020

fifthimage

Microsoft Learn

Learn how to build the business apps that you need.

Top Kudoed Authors
Users Online
Currently online: 180 members 4,897 guests
Please welcome our newest community members: