cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
RomanKorchak Helper IV
Helper IV

Collect (SPList, ThisItem) not working

Hi All

I have 2 SharePoint lists and I need to be able to copy items from one to another (List1, List2, both lists has same columns)

So I create collection List1C, add Gallery with items:List1C, add button to Gallery items and add to button OnSelect 

    Collect(List2,ThisItem)
But its not doing anything (not adding item to SharePoint List2) and not giving any errors. I tried re adding SP Lists, recreating - no luck 😞 

Any idea?

Thanks 

8 REPLIES 8
Super User
Super User

Re: Collect (SPList, ThisItem) not working

@RomanKorchak
Perhaps you can try changing this code:
Collect(List2,ThisItem)

Into this code instead.
Collect(List2,Gallery1.Selected)
RomanKorchak Helper IV
Helper IV

Re: Collect (SPList, ThisItem) not working

Just tried it - still not doing it 🙄

RomanKorchak Helper IV
Helper IV

Re: Collect (SPList, ThisItem) not working

Getting "Specified column 'Button12' doesnt exist" .  Button12 - is a button to add item to SP List.

I may try removing that button from Gallery.Selected or something like it, but I need all the data from that item to be added to SP List, not only shown in Gallery. 

Super User
Super User

Re: Collect (SPList, ThisItem) not working

Deleted
Highlighted
Super User
Super User

Re: Collect (SPList, ThisItem) not working

May I please have a screenshot of your app for context?
Super User
Super User

Re: Collect (SPList, ThisItem) not working

Hi, I tried to replicate your scenario. I have 2 collections C1 and C2. They both have 2 columns Name and Desc. I have a gallery of C1 with an OnSelect property set to Collect(C2, ThisItem) and I have another gallery of C2. The C2 gallery initially is blank but once I click on any one row from C1 gallery (Name2 in my example), that row gets added to C2 and displays in the C2 gallery as well. Please let me know how your example is diff from this. 

 

If you like this reply, please give kudos. And if this solves your problem, please accept this reply as the solution. Thanks!

Hardit(Haman)

RomanKorchak Helper IV
Helper IV

Re: Collect (SPList, ThisItem) not working

Problem is that Collect(SPList2,ThisItem) does not add new item into SharePoint list SPList2.

If I create a collection from SharePoint list
    ClearCollect(Col1, SPList1);      ClearCollect(Col2, SPList2);
and add item into Col2 from Col1 (Collect(Col2,ThisItem) )- it works, but I need to add an item into SharePoint list, so 
  Collect(SPList2, ThisItem)  on selecting item in Gallery with Col1 or SPList1 not adding item into SPList2 and not showing any errors  

RomanKorchak Helper IV
Helper IV

Re: Collect (SPList, ThisItem) not working

Just used Monitor toll (Advanced Tools > Open Monitor) and found that Collect(SPList,ThisItem) is using "operation">"getRows"

 


, where if I create a record
    UpdateContext({record1:{Coumn1:"Val1"}}) 
and then use it to add item to SP List
   Collect(SPList, record1)
it works, and opration is "createRow"
   createRow.PNG

Helpful resources

Announcements
MBAS Gallery 2020

MBAS Gallery 2020

Watch Microsoft Business Applications Summit sessions on-demand.

firstImage

New Ranks and Rank Icons released on April 21!

The time has come: We are finally able to share more details on the brand-new ranks coming to the Power Apps Community!

Power Platform 2020 release wave 1 plan

Power Platform 2020 release wave 1 plan

Features releasing from April 2020 through September 2020

Top Solution Authors
Top Kudoed Authors
Users online (708)