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

How to patch a SP List 'B' Lookup column of SP List 'A' ID?

I have added lookup column to List 'B' from List 'A' ID. Lookup column name is 'ProjectID'. But when I am patching it is not recognizing the 'ProjectID'. Error saying `The Specified column 'ProjectID' does not exists`

 

ForAll(MileStoneCollection,Patch(Milestones,Defaults(Milestones),
{Title:MileStoneTitle,Projected_x0020_Date:ProjectedDate,
Completed_x0020_Date:CompletedDate,ProjetID:CurrentItem.ID}))

 

prom1.png

I also tried this too... How to patch this?

 

ForAll(MileStoneCollection,Patch(Milestones,Defaults(Milestones),
{Title:MileStoneTitle,
Projected_x0020_Date:ProjectedDate,
Completed_x0020_Date:CompletedDate,
ProjetID:{
'@odata.type':"#Microsoft.Azure.Connectors.SharePoint.SPListExpandedReference",
Id:CurrentItem.ID,
Value:CurrentItem.ID}))

UPDATE: 

 

If I remove ProjectID from Pathch, It is saying ProjectID is requiredfield. I don't know where to add this.

1 ACCEPTED SOLUTION

Accepted Solutions
v-xida-msft
Community Support
Community Support

Hi @Itsmesri,

Could you please share a bit more about the CurrentItem that you mentioned within your formula?

Do you want to set a value for the LookUp column of your List B within the Patch formula?

Which value do you want to set

If you want to set a value for the LookUp column of your List B within the Patch formula, please take a try with the following workaround:

Modify your formula as below:

ForAll(
MileStoneCollection,
Patch(
Milestones,
Defaults(Milestones), {
Title: MileStoneTitle, Projected_x0020_Date: ProjectedDate, Completed_x0020_Date: CompletedDate, ProjetID:{ '@odata.type':"#Microsoft.Azure.Connectors.SharePoint.SPListExpandedReference", Id: LookUp('YourListA',ID= CurrentItem.ID, ID), /* <-- Search the corresponding ID related to the saved value within your List A */ Value: CurrentItem.ID /* <-- type the value you want to save into the LookUp column*/
}
} /* <-- don't miss this } character here */
)
)

More details about set a value for a LookUp column of a SP list, please check and see if my response within the following article would help in your scenario:

https://powerusers.microsoft.com/t5/Creating-Apps/Default-Dropdown/m-p/159618

 

Best regards,

Kris

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

View solution in original post

2 REPLIES 2
v-xida-msft
Community Support
Community Support

Hi @Itsmesri,

Could you please share a bit more about the CurrentItem that you mentioned within your formula?

Do you want to set a value for the LookUp column of your List B within the Patch formula?

Which value do you want to set

If you want to set a value for the LookUp column of your List B within the Patch formula, please take a try with the following workaround:

Modify your formula as below:

ForAll(
MileStoneCollection,
Patch(
Milestones,
Defaults(Milestones), {
Title: MileStoneTitle, Projected_x0020_Date: ProjectedDate, Completed_x0020_Date: CompletedDate, ProjetID:{ '@odata.type':"#Microsoft.Azure.Connectors.SharePoint.SPListExpandedReference", Id: LookUp('YourListA',ID= CurrentItem.ID, ID), /* <-- Search the corresponding ID related to the saved value within your List A */ Value: CurrentItem.ID /* <-- type the value you want to save into the LookUp column*/
}
} /* <-- don't miss this } character here */
)
)

More details about set a value for a LookUp column of a SP list, please check and see if my response within the following article would help in your scenario:

https://powerusers.microsoft.com/t5/Creating-Apps/Default-Dropdown/m-p/159618

 

Best regards,

Kris

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

View solution in original post

Hello Team,

 

I have 3 SharePoint List.

1. List A

2. List B

3. List C

 

List C has lookup from List A and List B.

 

I using following formula but it's not working.

Patch(Problem,Defaults(Problem),    
{ServiceRequestLogId:{'@odata.type':"#Microsoft.Azure.Connectors.SharePoint.SPListExpandedReference",Id:selectedItem.ID, Value:selectedItem.Title},
ProductId:{'@odata.type':"#Microsoft.Azure.Connectors.SharePoint.SPListExpandedReference",IdSmiley TongueroductDropdown.Selected.ID, ValueSmiley TongueroductDropdown.Selected.Title}})

Please guide.

Helpful resources

Announcements
PA_User Group Leader_768x460.jpg

Manage your user group events

Check out the News & Announcements to learn more.

Community Connections 768x460.jpg

Community & How To Videos

Check out the new Power Platform Community Connections gallery!

Welcome Super Users.jpg

Super User Season 2

Congratulations, the new Super User Season 2 for 2021 has started!

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.

Top Solution Authors
Top Kudoed Authors
Users online (1,041)