cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Djack
Helper I
Helper I

Collection to SharepointColum

I have a collection with ID.

This collection needs to be writen to a specific column in a SPList. Is this possible?

 

 

1 ACCEPTED SOLUTION

Accepted Solutions

thanks you all 

I used a linking table to keep track of all the links.

 

 

View solution in original post

6 REPLIES 6
mdevaney
Super User
Super User

@Djack 
Suppose your collection called yourCollection ID column looks like this:

 

ID
345
346
347

 

To write this to a specific column in SharePoint you could use this code

ForAll(
    yourCollection,
    Patch(
        your_datasource_name,
        Defaults(your_datsource_name),
        {targetColumnName: yourCollection[@ID]})
);

 

---
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."

Yes indd my Collection CS_LinkedContracten looks like that

 

Value 

1234
4152

...

 

ForAll(CS_LinkedContracten,
Patch(
BEWONERS_CONTRACTEN,
ContractID=ThisItem.ContractID,
{LinkedCustomerID:CS_LinkedContracten[@Value]}
));

@Djack 

OK, then please try my code and tell me if it works.  If not, tell me what happened.

 

---
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." 

Hi @Djack ,

Do you want to update all the LinkedCustomerID field in BEWONERS_CONTRACTEN by using the Value field in CS_LinkedContracten(when with same ContractID value)?

If so, could you tell me the data type of :
1)ContractID in BEWONERS_CONTRACTEN and CS_LinkedContracten

2)LinkedCustomerID field in BEWONERS_CONTRACTEN , Value field in CS_LinkedContracten

 

I assume that ContractID in BEWONERS_CONTRACTEN and CS_LinkedContracten is the same data type,

LinkedCustomerID field in BEWONERS_CONTRACTEN , Value field in CS_LinkedContracten is the same data type.

 

If so, try this formula:

ForAll(CS_LinkedContracten,
Patch(
BEWONERS_CONTRACTEN,
ContractID=CS_LinkedContracten[@ContractID],  //[@] is used when you have two same field names
{LinkedCustomerID:Value}
));

 

Here's a doc about this in details for your reference:
https://powerapps.microsoft.com/en-us/blog/bulk-update-using-forall-and-patch/

 

 

 

Best regards,

Community Support Team _ Phoebe Liu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

thanks you all 

I used a linking table to keep track of all the links.

 

 

@Djack 
Please Accept A Solution in this thread even if it is your own post.  It lets others know the issue has been solved.

---
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."

Helpful resources

Announcements
October Events

Mark Your Calendars

So many events that are happening this month - don't miss out!

Ignite 2022

WHAT’S NEXT AT MICROSOFT IGNITE 2022

Explore the latest innovations, learn from product experts and partners, level up your skillset, and create connections from around the world.

Power Apps Africa Challenge 2022

Power Apps Africa Challenge

Your chance to join an engaging competition of Power Platform enthusiasts.

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