cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Kevin_Maxwell
Advocate I
Advocate I

Submit/Patch multiple results/items from Collection to SharePoint list

I'm trying to insert new collection results to SharePoint list. However, I get "An error occurred on the server.". I have checked all my required fields and non of them are causing issues. Am I missing something? Is there any other method to use?

 

 

ForAll(Beneficiary_Collection,
Patch(Beneficiary,
    {
    Beneficiary_Code: Beneficiary_Code,
    Order_Number: Value(Order_Number),
    First_Name: First_Name,
    Last_Name: Last_Name,
    Gender:
    {
    '@odata.type' : "#Microsoft.Azure.Connectors.SharePoint.SPListExpandedReference",
    Id: LookUp( Gender_Lookup, Gender = English_Def, ID ),
    Value: LookUp( Gender_Lookup, Gender = English, English_Def )
    },
    Date_Of_Birth: Date_of_Birth
    })
)

Thanks

1 ACCEPTED SOLUTION

Accepted Solutions
Kevin_Maxwell
Advocate I
Advocate I

I just found the answer and it is Defaults(Beneficiary). So, in order to create new values, basically Defaults should be used.

 

End result:

 

ForAll(Beneficiary_Collection,
Patch(Beneficiary, Defaults(Beneficiary),
    {
    Beneficiary_Code: Beneficiary_Code,
    Order_Number: Value(Order_Number),
    First_Name: First_Name,
    Last_Name: Last_Name,
    Gender:
    {
    '@odata.type' : "#Microsoft.Azure.Connectors.SharePoint.SPListExpandedReference",
    Id: LookUp( Gender_Lookup, Gender = English_Def, ID ),
    Value: LookUp( Gender_Lookup, Gender = English, English_Def )
    },
    Date_Of_Birth: Date_of_Birth
    })
)

View solution in original post

1 REPLY 1
Kevin_Maxwell
Advocate I
Advocate I

I just found the answer and it is Defaults(Beneficiary). So, in order to create new values, basically Defaults should be used.

 

End result:

 

ForAll(Beneficiary_Collection,
Patch(Beneficiary, Defaults(Beneficiary),
    {
    Beneficiary_Code: Beneficiary_Code,
    Order_Number: Value(Order_Number),
    First_Name: First_Name,
    Last_Name: Last_Name,
    Gender:
    {
    '@odata.type' : "#Microsoft.Azure.Connectors.SharePoint.SPListExpandedReference",
    Id: LookUp( Gender_Lookup, Gender = English_Def, ID ),
    Value: LookUp( Gender_Lookup, Gender = English, English_Def )
    },
    Date_Of_Birth: Date_of_Birth
    })
)

View solution in original post

Helpful resources

Announcements
UG GA Amplification 768x460.png

Launching new user group features

Learn how to create your own user groups today!

Power Apps Community Call Jan. 2022 768x460.png

Power Apps Community Call

Please join us on Wednesday, January 19th, at 8a PDT. Come and learn from our amazing speakers!

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 (1,758)