cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
ychaitanya5g
Helper I
Helper I

Getting error in Patch function and collections

Hi Team,

 

I am getting error while inserting this code in OnSuccess function in powerapps  form

 

ForAll(Descriptioncollection,Patch('Des of Items',Defaults('Des of Items'),{'Description of I:DescriptionItem,Items of Desc:DesItems,MID:Form2.LastSubmit.ID}))

 

If colons are added in between items it is not showing any errors but 

ForAll(Descriptioncollection,Patch('Des of Items',Defaults('Des of Items'),{'Description of I':DescriptionItem,'Items of Desc':DesItems,MID:Form2.LastSubmit.ID}))

 

values are not updating in the list

 

 

 

 

17 REPLIES 17
mdevaney
Super User
Super User

@ychaitanya5g 
From what I can tell there was a syntax error where you were missing two single quotes ( ' ).  I have highlighted these in red.

ForAll
(
    Descriptioncollection,
    Patch(
        'Des of Items',
        Defaults('Des of Items'),
        {
            'Description of I':DescriptionItem,
            'Items of Desc'DesItems,
            MIDForm2.LastSubmit.ID
        }
  )
)
 
 
If you are still receiving errors after this make sure to share the error message in a screenshot.
 
---
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."

I tried the snippet you shared, My second code I inserted is same. I am unable to send the data or save the data 

into the List.

@ychaitanya5g
Please provide a screenshot of the error message you are receiving.

I am not getting any error, my data is not moving to sharepoint from collections to sharepoint

 

Is it possible to do in powerapps app or powerapps form

Hi @ychaitanya5g ,

 

The code syntax looks good, but I want you to check whether the required column, maybe 'Title', is included in Patch function?

SIk

 

 

No required column is patched in this code, I already checked and deployed

Hi @ychaitanya5g 

 

Could you please share the column construct of the SP list? In general, the column 'Title' is required by default. Did you modify it?

In addition, please share more information about Descriptioncollection and 'Des of Items'. What are the column types you try to patch?

 

In order to debug your code, please try the following formulas to see if it works.

Patch('Des of Items',Defaults('Des of Items'),{'Description of I':"Test",'Items of Desc':"Test",MID:1})

Patch('Des of Items',First('Des of Items'),{'Description of I':"Test",'Items of Desc':"Test",MID:1})

 

Please let me know the test result.

Sik

 

I am following steps in the below video wise

 https://www.youtube.com/watch?v=xgznk4XlPCo

 

i created the Descriptioncollection collection and patching 

in onselect method 

"Patch(Descriptioncollection,ThisItem,{DescriptionItem:TextInput6.Text,DesItems:Value(TextInput7.Text)});Collect(Descriptioncollection,{DescriptionItem:"",DesItems:0});"

 

In the form onsuccess function I pasted this function

 

ForAll(
Descriptioncollection,
Patch(
'Des of Items',
Defaults('Des of Items'),
{
'Description of I':DescriptionItem,
'Items of Desc': Value(DesItems),
MID: Form2.LastSubmit.ID
}
)
)

 

I am not using the Title, and i enabled it as non required.

 

Helpful resources

Announcements
UG GA Amplification 768x460.png

Launching new user group features

Learn how to create your own user groups today!

Community Connections 768x460.jpg

Community & How To Videos

Check out the new Power Platform Community Connections gallery!

M365 768x460.jpg

Microsoft 365 Collaboration Conference | December 7–9, 2021

Join us, in-person, December 7–9 in Las Vegas, for the largest gathering of the Microsoft community in the world.

Top Solution Authors
Top Kudoed Authors
Users online (1,993)