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 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
PA User Group

Welcome to the User Group Public Preview

Check out new user group experience and if you are a leader please create your group

MBAS Attendee Badge

Claim Your Badge & Digital Swag!

Check out how to claim yours today!

secondImage

Demo Extravaganza is Back!

We are excited to announce that Demo Extravaganza for 2021 has started!

MBAS on Demand

Microsoft Business Applications Summit sessions

On-demand access to all the great content presented by the product teams and community members! #MSBizAppsSummit #CommunityRocks

Top Solution Authors
Top Kudoed Authors
Users online (21,271)