cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
Jayendra929
Level: Powered On

LookUp Column Inserting into Sharepoint List

HI To all,

 

I am Created a Scratch App. I created a Registeration screen with save Button and the Column fields are 3 Single line text Columns and 1 lookup Column and the look up Column is DepartmentID.I am Loading the lookup Columns values but while i am selected the perticular item in dropdown list how we need to save for look up Column and here which i writen the patch function is Below

 

Patch(Employee, Defaults( Employee ), {Title:txttitle,EmpName:txtname.Text,EmployeeGender:ddlGender.Selected.Value,EmployeeEmailID:txtEmailID.Text,EmpRoleNumber:Value(txtEmplyeeRollNumber.Text),DepartmentID:LookUp(Employee,DepartmentID=ddlDepartment.Selected.DepartmentName)}).

 

Their are Two List 1 is employee and the 2 nd is Department list and i am showing the department Name is showing registeration Screen .

 

While i am saving the data with out look column it is saving but if adding lookup column it si not saving.Can you tell me How to write the path function with look up column for saving the data in sharepoint list.

 

Can you Give any Suggestion please.

 

1 ACCEPTED SOLUTION

Accepted Solutions
Community Support Team
Community Support Team

Re: LookUp Column Inserting into Sharepoint List

Hi @Jayendra929 ,

Do you want to update Lookup field?

Try this formula:

Patch(Employee, Defaults( Employee ), 
{Title:txttitle,EmpName:txtname.Text,
EmployeeGender:ddlGender.Selected.Value,
EmployeeEmailID:txtEmailID.Text,EmpRoleNumber:Value(txtEmplyeeRollNumber.Text),
DepartmentID:LookUp(Choices(Employee.DepartmentID),Value=ddlDepartment.Selected.DepartmentName)
})

Here's a doc about how to use complex data type of sharepoint list:

https://powerapps.microsoft.com/en-us/blog/default-values-for-complex-sharepoint-types/

 

 

Best regards,

Community Support Team _ Phoebe Liu

 

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.
2 REPLIES 2
shailendra74
Level 8

Re: LookUp Column Inserting into Sharepoint List

for DepartmentID the value to be passed should be as below

 

{
'@odata.type' : "#Microsoft.Azure.Connectors.SharePoint.SPListExpandedReference",
Id:ddlDepartment.Selected.DepartmentID,
Value:ddlDepartment.Selected.DepartmentName
}

 

Thanks. 

Community Support Team
Community Support Team

Re: LookUp Column Inserting into Sharepoint List

Hi @Jayendra929 ,

Do you want to update Lookup field?

Try this formula:

Patch(Employee, Defaults( Employee ), 
{Title:txttitle,EmpName:txtname.Text,
EmployeeGender:ddlGender.Selected.Value,
EmployeeEmailID:txtEmailID.Text,EmpRoleNumber:Value(txtEmplyeeRollNumber.Text),
DepartmentID:LookUp(Choices(Employee.DepartmentID),Value=ddlDepartment.Selected.DepartmentName)
})

Here's a doc about how to use complex data type of sharepoint list:

https://powerapps.microsoft.com/en-us/blog/default-values-for-complex-sharepoint-types/

 

 

Best regards,

Community Support Team _ Phoebe Liu

 

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.

Helpful resources

Announcements
firstImage

Watch Sessions On Demand!

Continue your learning in our online communities.

Power Platform 2019 release wave 2 plan

Power Platform 2019 release wave 2 plan

Features releasing from October 2019 through March 2020

FirstImage

Power Platform World Tour

Coming to a city near you

thirdimage

PowerApps Community User Group Member Badge

Fill out a quick form to claim your user group badge now!

FourthImage

Join PowerApps User Group!!

Connect, share, and learn with your peers year-round

SecondImage

Power Platform Summit North America

Register by September 5 to save $200

Users Online
Currently online: 196 members 5,631 guests
Please welcome our newest community members: