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

Unable to successfully create new items in SharePoint list from a collection

For the OnStart of the home screen, i have ClearCollect(colOrders, Orders List); Clear(colOrders).

 

The application displays items on in a gallery on that screen from a different list.  When the user selects an item to be ordered, the OnSelect does a Collect(colOrders, {Title:title_field.value, etc.}) setting various fields as text, numbers, dates and lookup/choice fields.  Along the way, colOrders has correct entries and values.

 

When the user finishes selecting items, the user can navigate to a cart screen which correctly displays the items ordered.  there is a submit button which has for OnSelect Collect('Orders List',)Defaults,colOrders); Clear(colOrders)  This executes only for the briefest of moments and then the gallery shows empty, but there are no records added to the Orders List.

 

I have tried Patch('Orders List',(Defaults(colOrders)) but i get an error on the expression that Title is required.  I also tried a ForALL with the Patch but still get Title field required error on the expression.  Title shows in the collection col Orders and has a specific value set each time an item is added to the collection.  I am not sure in the Patch expression how to get Title values to explicitly add since it is a table.

 

I could really use some help on this.  Forum comments are all over the place and documentation is sparsely written.

1 ACCEPTED SOLUTION

Accepted Solutions
Super User
Super User

Re: Unable to successfully create new items in SharePoint list from a collection

you Patch function would look something like this:

 

 

ForAll(
    colOrders,
    Patch(
        'Orders List',
        Defaults('Orders List'),
        { Title:Title , FieldName2:FieldName2 , FieldName3:FieldName3}
    )
)

 

Since it sounds like all the column names in the collection match the column names in the SharePoint list then the field and value pair will be the same for each field you want to update. (example Title:Title)

 



--------------------------------------------------------------------------------
If this post helps answer your question, please click on “Accept as Solution” to help other members find it more quickly. If you thought this post was helpful, please give it a Thumbs Up.
2 REPLIES 2
Super User
Super User

Re: Unable to successfully create new items in SharePoint list from a collection

you Patch function would look something like this:

 

 

ForAll(
    colOrders,
    Patch(
        'Orders List',
        Defaults('Orders List'),
        { Title:Title , FieldName2:FieldName2 , FieldName3:FieldName3}
    )
)

 

Since it sounds like all the column names in the collection match the column names in the SharePoint list then the field and value pair will be the same for each field you want to update. (example Title:Title)

 



--------------------------------------------------------------------------------
If this post helps answer your question, please click on “Accept as Solution” to help other members find it more quickly. If you thought this post was helpful, please give it a Thumbs Up.

Re: Unable to successfully create new items in SharePoint list from a collection

already sorted this out, but have new issues now!

Helpful resources

Announcements
firstImage

Watch Sessions On Demand!

Continue your learning in our online communities.

SecondImage

PowerApps Monthly Community Call

Next Wednesday, August 21st at 8am PDT

Top Community Contributors for July 2019

Top Community Contributors for July 2019

Let's thank our top community contributors

Power Platform 2019 release wave 2 plan

Power Platform 2019 release wave 2 plan

Features releasing from October 2019 through March 2020

FirstImage

Power Platform World Tour

Coming to a city near you

thirdimage

PowerApps Community User Group Member Badge

Fill out a quick form to claim your user group badge now!

FourthImage

Join PowerApps User Group!!

Connect, share, and learn with your peers year-round

FifthImage

Dynamics 365 and Power Platform April 2019 Release notes

Features releasing from April 2019 through September 2019!

SixthImage

Power Summit Australia 2019

August 20-23rd 2019

Users Online
Currently online: 27 members 3,854 guests
Recent signins:
Please welcome our newest community members: