cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Lee123
Frequent Visitor

Append patching a lookup column

Hi
I have a lookup column in a different datasource that I want to patch to, but the following code overwrites the content of that column.
 
Patch(Organisations,
LookUp(Organisations, ID = orgsPickerEditContactsCombo.Selected.Id),

{PersonsAssociated:Table({'@odata.type':"#Microsoft.Azure.Connectors.SharePoint.SPListExpandedReference",
Id:ThisItem.ID,
Value:ThisItem.FullName})
}
)
 
What I want is for it to append to it. How can I do that?
 
Thank you
Lee
1 ACCEPTED SOLUTION

Accepted Solutions
v-xiaochen-msft
Community Support
Community Support

Hi @Lee123 ,

 

Please try this formula:

ClearCollect(ColCollection,LookUp(Organisations,ID=orgsPickerEditContactsCombo.Selected.Id).PersonsAssociated);Collect(ColCollection,{Id:ThisItem.ID,Value:ThisItem.FullName});Patch(Organisations,LookUp(Organisations,ID=orgsPickerEditContactsCombo.Selected.Id),{PersonsAssociated:ColCollection})

 

Best Regards,
Wearsky
If my post helps, then please consider Accept it as the solution to help others. Thanks.

View solution in original post

2 REPLIES 2
v-xiaochen-msft
Community Support
Community Support

Hi @Lee123 ,

 

Please try this formula:

ClearCollect(ColCollection,LookUp(Organisations,ID=orgsPickerEditContactsCombo.Selected.Id).PersonsAssociated);Collect(ColCollection,{Id:ThisItem.ID,Value:ThisItem.FullName});Patch(Organisations,LookUp(Organisations,ID=orgsPickerEditContactsCombo.Selected.Id),{PersonsAssociated:ColCollection})

 

Best Regards,
Wearsky
If my post helps, then please consider Accept it as the solution to help others. Thanks.

View solution in original post

Lee123
Frequent Visitor

Thank you Wearsky that works although I did need to change the ID's to names.

Helpful resources

Announcements
PA User Group

Welcome to the User Group Public Preview

Check out new user group experience and if you are a leader please create your group

secondImage

Demo Extravaganza is Back!

We are excited to announce that Demo Extravaganza for 2021 has started!

MBAS on Demand

Microsoft Business Applications Summit sessions

On-demand access to all the great content presented by the product teams and community members! #MSBizAppsSummit #CommunityRocks

Power Apps June 2021

June Power Apps Community Call

Don't miss the call this month on June 16th - 8a PDT

Top Solution Authors
Top Kudoed Authors
Users online (75,192)