cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Seeddraver
Regular Visitor

Trouble with updateif with sharepoint item lookup

I been trying to  make an update to item in sharepoint usein a button, I have a lookup field name restaurante ,  also a choice selector TIpoComida, some of the fields are string o yes/no, but I try patch , updateif, nothing works, every time the error is restaurante is a record and return an error o number, also try different ways of lookup this is my code so far but still with errors, thanks in advance.

 

 

 

 

 

 

UpdateIf(GastosRestaurante;
ID = ThisItem.ID;
{
Title: DataCardValue24_1.Text;
Restaurante:{ '@odata.type':"#Microsoft.Azure.Connectors.SharePoint.SPListExpandedReference";
Id: DataCardValue9_2.Selected.Id;
Value: DataCardValue9_2.Selected.Value};
FechaConsumo: DataCardValue28_1.SelectedDate;
Valor: DataCardValue24_2;
Invitados:Toggle1.Value;
CantidadInvitados:DataCardValue24_3;
TipoComida:DataCardValue9_3.Selected;
}
)
Back()

 

 

 

 

 

 

2 ACCEPTED SOLUTIONS

Accepted Solutions
PowerRanger
Super User
Super User

@Seeddraver 

The field restaurante expects a record in this layout

{
Id: 2,
Value: "MN"
}

 

 




​Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item.

If the content was useful in other ways, please consider giving it Thumbs Up.

View solution in original post

i did this en green and remove back() and now works, mmm weird thanks 

Restaurante: DataCardValue9_2.Selected;
FechaConsumo: DataCardValue28_1.SelectedDate;
Valor: DataCardValue24_2;
Invitados:Toggle1.Value;
CantidadInvitados:DataCardValue24_3;
TipoComida:DataCardValue9_3.Selected

View solution in original post

3 REPLIES 3
PowerRanger
Super User
Super User

@Seeddraver 

The field restaurante expects a record in this layout

{
Id: 2,
Value: "MN"
}

 

 




​Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item.

If the content was useful in other ways, please consider giving it Thumbs Up.

i did this en green and remove back() and now works, mmm weird thanks 

Restaurante: DataCardValue9_2.Selected;
FechaConsumo: DataCardValue28_1.SelectedDate;
Valor: DataCardValue24_2;
Invitados:Toggle1.Value;
CantidadInvitados:DataCardValue24_3;
TipoComida:DataCardValue9_3.Selected

@Seeddraver the green part will give you a record just like I have posted. When you highlite the green part you should see the record just below the Formular bar.




​Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item.

If the content was useful in other ways, please consider giving it Thumbs Up.

Helpful resources

Announcements
Power Apps News & Annoucements carousel

Power Apps News & Announcements

Keep up to date with current events and community announcements in the Power Apps community.

Community Call Conversations

Introducing the Community Calls Conversations

A great place where you can stay up to date with community calls and interact with the speakers.

Power Apps Community Blog Carousel

Power Apps Community Blog

Check out the latest Community Blog from the community!

Top Solution Authors
Top Kudoed Authors
Users online (5,685)