cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
KotaroKo
Helper III
Helper III

Writing two different structured sharepoint lists into the collection

Hi, guys! I have two different kind of logs and I want to sum them up into one collection. So I have two sharepoint lists : Logs and logsForBooks. When I use this code, it doesn't add logsForBooks items into the collection. I don't know why. What am I doing wrong? The code is this: ClearCollect(FullLogs,ShowColumns(Logs,"Created","Title","OData__x10d3__x10d0__x10ec__x10e7__x10","OData__x10d3__x10d0__x10db__x10d7__x10","OData__x10e8__x10d5__x10d4__x10d1__x10")); ForAll(logsForBooks,Collect(FullLogs,{Created:Created},{Title:Title},{OData__x10d3__x10d0__x10ec__x10e7__x10:startDate},{OData__x10d3__x10d0__x10db__x10d7__x10:endDate},{OData__x10e8__x10d5__x10d4__x10d1__x10:ACCABook}));

4 REPLIES 4
KrishnaV
Super User III
Super User III

Hi @KotaroKo ,

 

Try your approach with Rename columns because I see the same columns:

 

ClearCollect(FullLogs,RenameColumns(SampleList,"Created","C1","Title","T1"));
ForAll('Employee Details',Collect(FullLogs,{C1:Created,T1:Title}));

 

 
I hope this resolved your issue if you see any challenge/need further help please let me know I am always happy to do it for my community.

Regards,
Krishna
If this post helps you give a 👍 and if it solved your issue consider Accept it as the solution to help the other members find it more.


I hope this resolved your issue if you see any challenge/need further help please let me know I am always happy to do it for my community.

Regards,
KrishnaV
Business Applications MVP, Microsoft Certified Trainer
Twitter | Linkedin | YouTube | GitHub
If this post helps you give a and if it solved your issue consider Accept it as the solution to help the other members / new members of the community.

I changed the code a bit to correct my mistake. I have tested that code and it is working as expected.


I hope this resolved your issue if you see any challenge/need further help please let me know I am always happy to do it for my community.

Regards,
Krishna
If this post helps you give a 👍 and if it solved your issue consider Accept it as the solution to help the other members find it more.


I hope this resolved your issue if you see any challenge/need further help please let me know I am always happy to do it for my community.

Regards,
KrishnaV
Business Applications MVP, Microsoft Certified Trainer
Twitter | Linkedin | YouTube | GitHub
If this post helps you give a and if it solved your issue consider Accept it as the solution to help the other members / new members of the community.

Hi, @KrishnaV, Thank you so much. Unfortunately, the second list as added to the collection but its structure is not correct. In one row there must be email, type of vacation, startdate, enddate. In my collection when the second list is added to the collections only one item is added to one row. so on the first row there is only startdate, on the second row there is only enddate and so on. I am attaching the screenshot. Any idea why it does that?

Hi @KotaroKo ,


I just want to follow up with you on this issue to see is it resolved or still you see any challenges.

If you see any challenge/need further help let me know I am always happy to help.

Regards,
Krishna
If this post helps give a 👍 and if it solved your issue consider Accept it as the solution to help the other members find it more


I hope this resolved your issue if you see any challenge/need further help please let me know I am always happy to do it for my community.

Regards,
KrishnaV
Business Applications MVP, Microsoft Certified Trainer
Twitter | Linkedin | YouTube | GitHub
If this post helps you give a and if it solved your issue consider Accept it as the solution to help the other members / new members of the community.

Helpful resources

Announcements
PA_User Group Leader_768x460.jpg

Manage your user group events

Check out the News & Announcements to learn more.

Power Query PA Forum 768x460.png

Check it out!

Did you know that you can visit the Power Query Forum in Power BI and now Power Apps

Carousel 2021 Release Wave 2 Plan 768x460.jpg

2021 Release Wave 2 Plan

Power Platform release plan for the 2021 release wave 2 describes all new features releasing from October 2021 through March 2022.

R2 (Green) 768 x 460px.png

Microsoft Dynamics 365 & Power Platform User Professionals

DynamicsCon is a FREE, 4 half-day virtual learning experience for 11,000+ Microsoft Business Application users and professionals.

Users online (2,115)