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.

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,805)