cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
RomanKorchak
Level: Powered On

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
mdevaney
Level 8

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
Level: Powered On

Re: Collect (SPList, ThisItem) not working

Just tried it - still not doing it 🙄

RomanKorchak
Level: Powered On

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. 

mdevaney
Level 8

Re: Collect (SPList, ThisItem) not working

Deleted
Highlighted
mdevaney
Level 8

Re: Collect (SPList, ThisItem) not working

May I please have a screenshot of your app for context?
PowerAddict
Level 8

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
Level: Powered On

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
Level: Powered On

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
thirdimage

Power Automate Community User Group Member Badge

Fill out a quick form to claim your user group badge now!

sixthImage

Power Platform World Tour

Find out where you can attend!

Power Platform 2019 release wave 2 plan

Power Platform 2019 release wave 2 plan

Features releasing from October 2019 through March 2020

fifthimage

Microsoft Learn

Learn how to build the business apps that you need.

Top Kudoed Authors
Users Online
Currently online: 211 members 6,372 guests
Please welcome our newest community members: