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

Submit Multiple Forms into One SharePoint List Entry

I'm working on a new mobile phone PowerApp that takes one large sharepoint list and divides the questions across multiple screens. This has resulted in multiple Edit Forms that I am looking to have all of them submit back to just one combined entry in the SharePoint list. Typically, when I do this, I just have the first Edit Form  have hidden datacards that match the datacardvalues of the other Edit Forms. Due to the large number of questions/columns, I was wondering if this is the best way to do this, or if there is an easier way?

1 ACCEPTED SOLUTION

Accepted Solutions
Dual Super User II
Dual Super User II

Hey @ngreen 

 

A better way to do this would be to use the Updates attributes of the form control on the final page as:
 
Patch(DataSourceName, Defaults(DataSourceName),Form1.Updates, Form2.Updates,Form3.Updates)
 
Hope this helps!
 
If this reply has answered your question or solved your issue, please mark this question as answered. Answered questions helps users in the future who may have the same issue or question quickly find a resolution via search. If you liked my response, please consider giving it a thumbs up. THANKS!

View solution in original post

6 REPLIES 6
Dual Super User II
Dual Super User II

Hey @ngreen 

 

A better way to do this would be to use the Updates attributes of the form control on the final page as:
 
Patch(DataSourceName, Defaults(DataSourceName),Form1.Updates, Form2.Updates,Form3.Updates)
 
Hope this helps!
 
If this reply has answered your question or solved your issue, please mark this question as answered. Answered questions helps users in the future who may have the same issue or question quickly find a resolution via search. If you liked my response, please consider giving it a thumbs up. THANKS!

View solution in original post

Super User III
Super User III

@ngreen 

You could PATCH the records as the user advances through each screen instead of using the SUBMIT function. 

 

My assumption is you will be distributing this survey to members of your organization through email.  When the user starts the survey you'll want to capture their email address.  This unique identifier will be used to create the blank survey record.  Put this code in the OnSelect property of your survey's start button.

 

Patch(
	your_datasource_name,
	Defaults(your_datasource_name),
	{email:User().Email}
);

 

Then create your first screen containing survey questions.  When you are done, put this code in the OnSelect property of the next screen button.  Of course, you'll have to change the question numbers to match the column names you want to update.

 

Patch(
	your_datasource_name,
	LookUp(your_datasource_name,email=User().Email),
	{question1:true,question2,false,question3:true}
)

 

Repeat this method on as many screens as you require.

 

You might be wondering why I am suggesting to create a new record right when the survey is started rather than wait until the end of the process.  This is because I prefer to save the user's progress on each page.  When a user is filling out a long form they may want to take a break or they may get interrupted so its a nice feature to have Smiley Very Happy

 

---
Please click "Accept as Solution" if my response helped to solve your issue so that others may find it more quickly. If your thought the post was helpful please give it a "Thumbs Up."

@yashag2255 

 

This worked! Thank you! 

Hi @yashag2255 , 

 

This helped me as well. KUDOS!!! Thank you very much!!!! 🙂

Afternoon

From what I am reading this should work,

 

Patch('SP List',Defaults('SP List'),form1.Updates,form2.Updates,form3.Updates, .... ,form 12.Updates)

 

but I am getting "the function patch has some invalid arguments" for some reason.

 

A little help would be appreciated.

 

I have a lot of columns on my SharePoint list.

 

Frequent Visitor

Yeah, found my error, I left out the last updates in my code.

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,016)