cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Tapesh
Post Prodigy
Post Prodigy

Collection update to sharepoint failed

Hi All, 
I'm trying to get the user input and save it as collection and then when there are 5 records or more collected, I want to save them to my SharePoint list. 

 

I have tried this using collect function put seems like not working. 

 

Can anyone help or suggest any idea? 

 

Please see the work i have done so far to get this. 

 

On add collection Button: 

OnSelect Property: 

 

 

Collect(
Records,
{
'Catering&HouseKeeping': DataCardValue49_2.Text,
'Casual_Transport': DataCardValue50_2.Text,
EquipmentShortLife: DataCardValue51_2.Text,
ProgrammeLifeSkills: DataCardValue52_2.Text,
'Cleaning&Household': DataCardValue59_2.Text,
'Medical&FirstAid': DataCardValue61_2.Text,
Heat: DataCardValue62_2.Text,
Total: DataCardValue12_1.Text
}
);ResetForm(GLForm_1);

 

 

 

On Save Button:

OnSelect Property: 

 

 

Collect('Description and GL Code', Records);

 

 

 

On Clear button: 

OnSelect: 

Clear(Records)

 

Also please see the below screenshot as an example to detail .

 

Any advice or suggestion is much appreciated by you all. 

THanks 

Display.png

1 ACCEPTED SOLUTION

Accepted Solutions
eka24
Community Champion
Community Champion

Am not sure of your columns names now after you corrected them, the this is the structure:

ForAll(Records, Patch(DecsriptionGLCode,
Defaults(DecsriptionGLCode),
{Catering:Catering,
EquipmentLife:EquipmentLife,
ProgrameLifeSkills:ProgrameLifeSkills,
Heat:Heat}))
Add all the other columns.
I assume the DecsriptionGLCode column names are the same as Records column names.
 
 

View solution in original post

12 REPLIES 12
eka24
Community Champion
Community Champion


I can see single quotes where there are no spaces in the column names, remove them. Also & is reserved so if yo can avoid using it in your column name. You can replace it with _

365CornerDawid
Resolver III
Resolver III

@Tapesh did you manage to resolve your challenge?

In your query you had something about number of records equals or greater than to enable option to submit data - do you need help with this part of your app?

 

Regards

Dawid

Hi, Yes please would liek to know where im wrong so that i do not repeat the same mistake again and how will this be avoided 

Sounds great will give it a try and see if this works or not. Thansk Sir 

Collect('DescriptionandGLCode',Records); 

 

This thing worked well and there is no error but when i click on SAVE collection to sharepoint list why is this not able to save to the given list? you have any idea how can this be done or what is the issue here? 

@eka24 @365CornerDawid 

eka24
Community Champion
Community Champion

Try this, single quotes removed :
Collect(DescriptionandGLCode,Records)

Hi @eka24 

 

No Change the result is same, i still can not see details on the my sharepoint list. 

 

Also as you said try to avoid quotation mark as much as i can i changed the whole list name and rename the columns in my SPList and also the list name. 

 

Please see the screen shot of SPList and also of current Powerapps where the collection is used. 

 

Display.pngDisplay2.pngUntitled.png

eka24
Community Champion
Community Champion

Am not sure of your columns names now after you corrected them, the this is the structure:

ForAll(Records, Patch(DecsriptionGLCode,
Defaults(DecsriptionGLCode),
{Catering:Catering,
EquipmentLife:EquipmentLife,
ProgrameLifeSkills:ProgrameLifeSkills,
Heat:Heat}))
Add all the other columns.
I assume the DecsriptionGLCode column names are the same as Records column names.
 
 

I assume this will work, but just want to clear something with you, is it compulsory to add all the columns which are present in the patch function?

or it is okay that only what i want i can update? 

i m actually confused on how this patch works, cause many times i want to use this but i feel that we must have to pass all the column names and value. which i feel is **bleep**. sometimes i only use a few of them. 

 

 

what is your suggestion on this?

Helpful resources

Announcements
Power Apps News & Annoucements carousel

Power Apps News & Announcements

Keep up to date with current events and community announcements in the Power Apps community.

Community Call Conversations

Introducing the Community Calls Conversations

A great place where you can stay up to date with community calls and interact with the speakers.

Power Apps Community Blog Carousel

Power Apps Community Blog

Check out the latest Community Blog from the community!

Top Solution Authors
Top Kudoed Authors
Users online (4,092)