cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Anonymous
Not applicable

Save a single power app form entry as multiple rows in SP lists

Hi all, 

 

In my power apps form, I have a form with a field called Dac No. The intention is to have the user enter multiple numbers separated by commas. I want this to save as different rows in SP lists. 

 

Eg. if the below were entered, I want 3 different rows saved in SP lists; one for 2039, one for 2021 and one for 2019. All other answers of the form should be saved identically for all 3 rows. 

latricekong_0-1625529537779.png

 

Any help would be greatly appreciated! Thank you 🙂 

5 REPLIES 5
Digital
Impactful Individual
Impactful Individual

The default behaviour for a form is to save one row/record to the datasource per form submission.

 

You could save the form by using patch instead.

 

First you would need to use the Split function on Dac No to break the contents into a table of substrings.

 

Split( DacNo.Text, "," )

 

 

 

Then you could use a combination of ForAll and Patch to save to your datasource. This is for saving a new record.

 

ForAll(
 Split( DacNo.Text, "," ),
 Patch(
   YourSharePointList,
   Defaults(YourSharePointList),
   {
     DacNo: ThisRecord.Result,
     All your other form fields would be patched here 
    }
 )
)

 

 

Anonymous
Not applicable

Thanks for your reply. Where do I input this formula?

 

'All your other form fields would be patched here' - could you give an example of the code that goes here? 

 

Sorry I'm quite new to power apps...

Thank you!

Digital
Impactful Individual
Impactful Individual

The formula would go in the OnSelect property of the button that saves the form.

 

The code in between the curly brackets are the SharePoint columns you want to update and the value on the right of the colon are the form field values. So whatever the fields are called in your form.

 

Title is mandatory in SharePoint when creating a new record.

 

Keep in mind this is for creating new records. If you want to be able to update existing records using patch you will need to change the code.

 

ForAll(
 Split( DacNo.Text, "," ),
 Patch(
   YourSharePointList,
   Defaults(YourSharePointList),
   {
     DacNo: ThisRecord.Result,
     Title: Whatever you want the title of each row to be
     ContractorCompany: ContractorCompany.Text,
     Discipline: Discipline.Selected.Value
    }
 )
)

 

Anonymous
Not applicable

I have an issue with my Yes/No sharepoint columns. 

The formula I used in the OnSelect of the submit button is: 

 

'Scope of works complete?': DataCardValue22.SelectedText

 

But I get this issue: 

latricekong_0-1625536631442.png

Do you know how to fix this? 

 

Thank you!

Digital
Impactful Individual
Impactful Individual

Try this instead:

 

DataCardValue22.Value

Helpful resources

Announcements
2022 Release Wave 1 760x460.png

2022 Release Wave 1 Plan

Power Platform release plan for the 2022 release wave 1 describes all new features releasing from April 2022 through September 2022.

User Group Leader Meeting January 768x460.png

Calling all User Group Leaders!

Don't miss the User Group Leader meetings on January, 24th & 25th, 2022.

Community Connections 768x460.jpg

Community & How To Videos

Check out the new Power Platform Community Connections gallery!

Top Solution Authors
Top Kudoed Authors
Users online (2,695)