cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Helper III
Helper III

A problem to submit three editform in one screen which all the editform data source come from one sharepoint list.

My powerapps desgin base on canvas. 

Because there are too many columns in my sharepoint list, and the range of each column I want to fill is different, so I created three editforms in the same editing screen (Screen2), each editform contains different columns in my sharepint list. .
I have a few questions below:
1. When I want to create an editform, the code with NewForm(Form1) &&NewForm(Form2)&&NewForm(Form3);Navigate(Screen2, UnCover) will cause three lines to be created in the sharepoint list. How can I create one line?


2. In Screen2 ,after i fill out the form. I use SubmitForm(Form1) && SubmitForm(Form2) && SubmitForm(Form3); This causes only one editform content to be saved in the sharepoint list. How can I submit the contents of the three editforms to the same line in the sharepointlist?

 

Best Regards
Dennis

2 REPLIES 2
Anonymous
Not applicable

Hi @Dennis_Qiang 

 

When you submit Form1, the datasource would be refreshed and so Form2 & Form3 will be refreshed.

 

So instead of submit form for form2 & 3, you need first update a collection and then  update the SP List Item with  corresponding SP ID by using either Patch or UpdateIf.

 

To update the collection, onChange of the controls in form2 & 3, 

 

UpdateIf(mycollection, ID = gallery.selected.ID, {fieldname: value }) // considering you are navigating from a gallery to edit screen.

 

Finally to update SP List item

 

SubmitForm(Form1); Patch('SP List', First(Filter(mycollection,ID = gallery.Selected.ID)))

 

Thanks.

Community Support
Community Support

Hi @Dennis_Qiang ,

Do you want to create single one item with your three form data?

 

Based on the issue that you mentioned, I think you have some misunderstanding on the Edit form in PowerApps. The Edit form is used to create a new record or edit an existing record in a SP List.

 

If your three Edit forms are in New mode, when you submit your three Edit forms, it would create three separated records within your SP list rather than single one record.

 

As an alternative solution, I think the Patch function could achieve your needs. I have made a test on my side, please take a try with the following workaround (set the OnSelect property of the "Submit" button to following😞

If(
   Form1.Mode = FormMode.New && Form2.Mode = FormMode.New && Form3.Mode = FormMode.New,
   Patch('YourSPList', Defaults('YourSPList'), Form1.Updates, Form2.Updates, Form3.Updates),    /* <-- Add new record */
   Patch('YourSPList', BrowseGallery1.Selected, Form1.Updates, Form2.Updates, Form3.Updates)    /* <-- Modify existing record */
)

Please consider take a try with above solution, check if the issue is solved.

 

Best regards,

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.

Helpful resources

Announcements
New Badges

New Solution Badges!

Check out our new profile badges recognizing authored solutions!

New Power Super Users

Congratulations!

We are excited to announce the Power Apps Super Users!

Power Apps Community Call

Power Apps Community Call: February

Did you miss the call? Check out the Power Apps Community Call here.

Microsoft Ignite

Microsoft Ignite

Join digitally, March 2–4, 2021 to explore new tech that's ready to implement. Experience the keynote in mixed reality through AltspaceVR!

Top Solution Authors
Top Kudoed Authors
Users online (49,477)