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

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
Community Support Team
Community Support Team

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
BenFetters
Level 8

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

 

Community Support Team
Community Support Team

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

TopShelf-MSFT
Level 10

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
New Ranks and Rank Icons in April

'New Ranks and Rank Icons in April

Read the announcement for more information!

Better Together’ Contest Finalists Announced!

'Better Together’ Contest Finalists Announced!

Congrats to the finalists of our ‘Better Together’-themed T-shirt design contest! Click for the top entries.

Power Platform 2019 release wave 2 plan

Power Platform 2019 release wave 2 plan

Features releasing from October 2019 through March 2020

thirdimage

Community Summit North America

Innovate, Collaborate, Grow - The top training and networking event across the globe for Microsoft Business Applications

Top Solution Authors
Top Kudoed Authors
Users online (8,697)