cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
Frequent Visitor

How to save form contents to multiple sharepoint list and edit it later

I have a power apps - canvas that serves as a questionnaire

 

It has multiple screens, each screen contains one question - each question has multiple fields. either textbox/es and radio button/s

 

How can I save these to a SharePoint list wherein one question = 1 or more sharepoint column

 

and how can I edit it later on? do I need to create a gallery so that users can see all items and they can edit their own (created) forms. What I am planning is to have a SharePoint list webpart with a link to edit that specific list item in PowerApps.

 

 

1 ACCEPTED SOLUTION

Accepted Solutions
Highlighted
Community Support
Community Support

Re: How to save form contents to multiple sharepoint list and edit it later

Hi @tonton ,

How do you list the Questions within the multiple screens of your app? From your SP List?

Could you please share a bit more about the data structure of your SP List?

Further, do you want to save the multiple fields of one question into a SP list? Do you want to save all Questions & Answers into single one same SP list or individual SP List (multiple SP lists)?

 

If you want to save all Questions & Answers into single one same SP list, I have made a test on my side, please take a try with the following workaround:

Patch(
       'YourSPList',
        Defaults('YourSPList'),
        {Title: "Questionnaire Test", QuestionTitle: "Question1", QuestionProperty1: TextInput1.Text, QuestionProperty2: TextInput2.Text,...},
        {Title: "Questionnaire Test", QuestionTitle: "Question2", QuestionProperty1: TextInput1.Text, QuestionProperty2: TextInput2.Text,...},
        {Title: "Questionnaire Test", QuestionTitle: "Question3", QuestionProperty1: TextInput1.Text, QuestionProperty2: TextInput2.Text,...},
        ...
)

If you want to save all Questions & Answers into individual SP List (multiple SP lists), I agree with @BenFetters 's thought almost. Please take a try with the following formula:

Patch(
       'YourSPList1',
        Defaults('YourSPList1'),
        {Title: "Questionnaire Test", QuestionTitle: "Question1", QuestionProperty1: TextInput1.Text, QuestionProperty2: TextInput2.Text,...}
);
Patch(
       'YourSPList2',
        Defaults('YourSPList2'),
        {Title: "Questionnaire Test", QuestionTitle: "Question2", QuestionProperty1: TextInput1.Text, QuestionProperty2: TextInput2.Text,...}
);
Patch(
       'YourSPList3',
        Defaults('YourSPList3'),
        {Title: "Questionnaire Test", QuestionTitle: "Question3", QuestionProperty1: TextInput1.Text, QuestionProperty2: TextInput2.Text,...}
);
...

More details about Patch function, please check the following article:

Patch function

 

In addition, if you want to edit the forms you created, I agree with your thought almost. You could consider add a Gallery control to list all items, then you could filter your own items based on some filter condition, then you could edit it.

 

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.

View solution in original post

3 REPLIES 3
Highlighted
Advocate V
Advocate V

Re: How to save form contents to multiple sharepoint list and edit it later

You could try using the Patch function and referencing several different controls throughout your app. You could use the patch function as many times as you need to submit the data to as many forms as you need. An example could be:

Patch(DataSource1,Default(DataSource1),{Anwer1:TextInput1.Text});Patch(DataSource2, Default(DataSource1),{Answer2: DropDown1.Selected.Value})

 

Does that help at all?

 

Kind regards,

Ben Fetters

 

Highlighted
Community Support
Community Support

Re: How to save form contents to multiple sharepoint list and edit it later

Hi @tonton ,

How do you list the Questions within the multiple screens of your app? From your SP List?

Could you please share a bit more about the data structure of your SP List?

Further, do you want to save the multiple fields of one question into a SP list? Do you want to save all Questions & Answers into single one same SP list or individual SP List (multiple SP lists)?

 

If you want to save all Questions & Answers into single one same SP list, I have made a test on my side, please take a try with the following workaround:

Patch(
       'YourSPList',
        Defaults('YourSPList'),
        {Title: "Questionnaire Test", QuestionTitle: "Question1", QuestionProperty1: TextInput1.Text, QuestionProperty2: TextInput2.Text,...},
        {Title: "Questionnaire Test", QuestionTitle: "Question2", QuestionProperty1: TextInput1.Text, QuestionProperty2: TextInput2.Text,...},
        {Title: "Questionnaire Test", QuestionTitle: "Question3", QuestionProperty1: TextInput1.Text, QuestionProperty2: TextInput2.Text,...},
        ...
)

If you want to save all Questions & Answers into individual SP List (multiple SP lists), I agree with @BenFetters 's thought almost. Please take a try with the following formula:

Patch(
       'YourSPList1',
        Defaults('YourSPList1'),
        {Title: "Questionnaire Test", QuestionTitle: "Question1", QuestionProperty1: TextInput1.Text, QuestionProperty2: TextInput2.Text,...}
);
Patch(
       'YourSPList2',
        Defaults('YourSPList2'),
        {Title: "Questionnaire Test", QuestionTitle: "Question2", QuestionProperty1: TextInput1.Text, QuestionProperty2: TextInput2.Text,...}
);
Patch(
       'YourSPList3',
        Defaults('YourSPList3'),
        {Title: "Questionnaire Test", QuestionTitle: "Question3", QuestionProperty1: TextInput1.Text, QuestionProperty2: TextInput2.Text,...}
);
...

More details about Patch function, please check the following article:

Patch function

 

In addition, if you want to edit the forms you created, I agree with your thought almost. You could consider add a Gallery control to list all items, then you could filter your own items based on some filter condition, then you could edit it.

 

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.

View solution in original post

Highlighted
Community Champion
Community Champion

Re: How to save form contents to multiple sharepoint list and edit it later

Thanks for posting in the community @tonton - can you review the above replies and update the thread on if they were helpful? 

 

Thank you,

 

@TopShelf-MSFT 

Helpful resources

Announcements
secondImage

Demo-Extravaganza 2020

Check out these cool Power Apps & vote on your favorite!

secondImage

Robotic Process Automation

Let's talk about the solution provided by Microsoft for Robotic Process Automation (RPA)

secondImage

Community Highlights

Check out whats happening in Power Apps

secondImage

Community User Group Member Badges

FIll out a quick form to claim your community user group member badge today!

Top Solution Authors
Top Kudoed Authors
Users online (7,304)