cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
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
Highlighted
Super User III
Super User III

Re: Getting error in Patch function and collections

@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."
Highlighted
Helper I
Helper I

Re: Getting error in Patch function and collections

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.

Highlighted
Super User III
Super User III

Re: Getting error in Patch function and collections

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

Re: Getting error in Patch function and collections

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

 

Highlighted
Helper I
Helper I

Re: Getting error in Patch function and collections

Is it possible to do in powerapps app or powerapps form

Highlighted
Community Support
Community Support

Re: Getting error in Patch function and collections

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

 

 

Highlighted
Helper I
Helper I

Re: Getting error in Patch function and collections

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

Highlighted
Community Support
Community Support

Re: Getting error in Patch function and collections

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

 

Highlighted
Helper I
Helper I

Re: Getting error in Patch function and collections

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
Community Conference

Power Platform Community Conference

Check out the on demand sessions that are available now!

Power Platform ISV Studio

Power Platform ISV Studio

ISV Studio is designed to become the go-to Power Platform destination for ISV’s to monitor & manage published applications.

secondImage

Power Platform 2020 release wave 2 plan

Features releasing from October 2020 through March 2021

Tech Marathon

Maratón de Soluciones de Negocio Microsoft

Una semana de contenido con +100 sesiones educativas, consultorios, +10 workshops Premium, Hackaton, EXPO, Networking Hall y mucho más!

Top Solution Authors
Top Kudoed Authors
Users online (6,701)