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

Patching a sharepoint list using ForAll() with new columns

I understand from watching one of Shane Young's videos that it is possible to patch a list (or any other connected data source). 

 

My sharepoint list, 'List_TableUpload1' contains the following columns: 'Title' and 'Calories'.

 

My app contains a single collection, Col_NewTable:

 

Calories      Flavour         Snack              Title

200             Hedgehog   Crisps              Snack 1

100             Acid             Strawberry      Snack 2

 

The following  OnSelect() code works fine, populating the 'Title' and 'Calories' columns:

 

ForAll(Col_NewTable,Patch(List_TableUpload1,Defaults(List_TableUpload1),{Title:Title,Calories:Calories}))

 

 

Presumably, this works ok because the 'title' and 'calories' columns are already inserted into the sharepoint list. 

 

But Shane Young suggests that the above code should be able to insert new columns into the table:

 

ForAll(Col_NewTable,Patch(List_TableUpload1,Defaults(List_TableUpload1),{Title:Title,Calories:Calories,Flavour:Flavour}))

 

 

The 'Flavour:Flavour' entry at the end generates an error: "The specified column 'Flavour' does not exist'.

Presumably this refers to the Sharepoint list (the column is contained in the collection, as shown above). 

 

Does this mean that I've entered the additional column incorrectly, and Shane Young's method still works fine in principle? Or has this method been superseded, in which case is there any alternative means of inserting new rows into a list? 

 

 

(Note: I understand that Sharepoint requires at least 1 column to be called title in order to validate the code above-this is rather annoying and whilst I am happy to work around it, I would additionally be interested in any way to get the list to populate without it!)

 

Thanks 🙂

 

 

 

1 ACCEPTED SOLUTION

Accepted Solutions
Highlighted
Community Support
Community Support

Re: Patching a sharepoint list using ForAll() with new columns

Hi @Anonymous ,

 

I don't think it is supported in PowerApps to create a new column for SharePoint.

You have to pre-create the column in SP list, before patching it in PowerApps.

Sik

 

View solution in original post

3 REPLIES 3
Highlighted
Super User
Super User

Re: Patching a sharepoint list using ForAll() with new columns

@Anonymous 

The "does not exist" error might be occurring couple of reasons:

  1. "Flavour" column was not manually added to SharePoint (you cannot add columns to SharePoint via Patch)
  2. The datasource needs to be Refreshed on the left-menu
  3. The column was originally called something other than "Flavour" but you changed the name

 

---
Please click "Accept as Solution" if my post answered your question so that others may find it more quickly. If you found this post helpful consider giving it a "Thumbs Up."

 

 

Highlighted
Community Support
Community Support

Re: Patching a sharepoint list using ForAll() with new columns

Hi @Anonymous ,

 

I don't think it is supported in PowerApps to create a new column for SharePoint.

You have to pre-create the column in SP list, before patching it in PowerApps.

Sik

 

View solution in original post

Highlighted
Anonymous
Not applicable

Re: Patching a sharepoint list using ForAll() with new columns

Ok, I've given this a lot of goes and it looks like you're right, sadly. I was just under the impression from Shane Young that adding new columns was possible (he appears to demonstrate this in the video I link to above). But perhaps updates to PowerApps have got rid of this feature, or his approach doesn't apply to my situation. 

 

Either way, thanks for clearing that up. For now, I will work on a solution assuming that all columns need to be pre-created in the sharepoint list. 

 

Thanks!

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!

secondImage

Power Platform 2020 release wave 2 plan

Features releasing from October 2020 through March 2021

Top Solution Authors
Top Kudoed Authors
Users online (10,405)