cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
ricardox180
Resolver I
Resolver I

Lookup field is not saved in SP List

Hi, everyone, i'm trying save a lookup field to SP list. I have used this code with Patch function : 

Id_Presupuesto_B:{
'@odata.type':"#Microsoft.Azure.Connectors.SharePoint.SPListExpandedReference";
Id:Value(Txt_Id_Pres.Text);
Value:Txt_Id_Pres.Text
}

It works with another app that i maked, but now is not working

1 ACCEPTED SOLUTION

Accepted Solutions

Hi @ricardox180 ,

 

OK, but you have to ensure there is a record in 'Solicitud de presupuesto' with Title column value of "Text(Last('Solicitud de Presupuesto').Título+1)".

Then there are two method to implement your needs.

1. 

Id_Presupuesto_B:{
'@odata.type':"#Microsoft.Azure.Connectors.SharePoint.SPListExpandedReference";
Id:LookUp('Solicitud de presupuesto', Título=Txt_Id_Pres.Text).ID;
Value:Txt_Id_Pres.Text
}

 2. 

Id_Presupuesto_B: LookUp(Choices('Presupuesto'.LookUpColumn), Value=Txt_Id_Pres.Text) 

 Hope this helps.

Sik

View solution in original post

4 REPLIES 4
v-siky-msft
Community Support
Community Support

Hi @ricardox180 ,

 

Please share more details about your scenario. What is Txt_Id_Pres.Text?

The data structure of lookup column is correct. But what I want to mention is that the Id field should be the ID value of parent record, and the Value field should be the related column value of parent record. Please check whether they are right?

In addition, here is another workaround:

Id_Presupuesto_B: LookUp(Choices('SP list'.LookUpColumn), Value=Txt_Id_Pres.Text) // if Txt_Id_Pres display the related column value

Or 

Id_Presupuesto_B: LookUp(Choices('SP list'.LookUpColumn), Id=Value(Txt_Id_Pres.Text)) // if Txt_Id_Pres display the ID column value​ of parent record

Hope this helps.

Sik

Hi! thanks for you reply, my Txt_Id_Pres.Text is my Title field on SP list. I have two list, "Presupuesto" and "Solicitud de presupuesto". On Txt_Id_Pres.Text i put the next code: Text(Last('Solicitud de Presupuesto').Título+1) . In "Presupuesto" i have the lookup filed associated with the "Title" field of "Solicitud de presupuesto". Basically i get the value from Txt_Id_Pres.Text

Hi @ricardox180 ,

 

OK, but you have to ensure there is a record in 'Solicitud de presupuesto' with Title column value of "Text(Last('Solicitud de Presupuesto').Título+1)".

Then there are two method to implement your needs.

1. 

Id_Presupuesto_B:{
'@odata.type':"#Microsoft.Azure.Connectors.SharePoint.SPListExpandedReference";
Id:LookUp('Solicitud de presupuesto', Título=Txt_Id_Pres.Text).ID;
Value:Txt_Id_Pres.Text
}

 2. 

Id_Presupuesto_B: LookUp(Choices('Presupuesto'.LookUpColumn), Value=Txt_Id_Pres.Text) 

 Hope this helps.

Sik

View solution in original post

This works! 

Id_Presupuesto_B:{
'@odata.type':"#Microsoft.Azure.Connectors.SharePoint.SPListExpandedReference";
Id:LookUp('Solicitud de presupuesto', Título=Txt_Id_Pres.Text).ID;
Value:Txt_Id_Pres.Text
}

Thanks! You helped me a lot

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.

PowerPlatform 768x460.png

Microsoft Learn

Check out our new Discover Your Career Path blog post series and get all the details.

Users online (1,065)