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

@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
News & Announcements

Community Blog

Stay up tp date on the latest blogs and activities in the community News & Announcements.

Power Apps Community Call

Power Apps Community Call- January

Mark your calendars and join us for the next Power Apps Community Call on January 20th, 8a PST

PP Bootcamp Carousel

Global Power Platform Bootcamp

Dive into the Power Platform stack with hands-on sessions and labs, virtually delivered to you by experts and community leaders.

secondImage

Power Platform Community Conference On Demand

Watch Nick Doelman's session from the 2020 Power Platform Community Conference on demand!

Top Solution Authors
Top Kudoed Authors
Users online (9,798)