cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted

Patch - The specified column does not exist

Hi, everyone!

My app has a gallery (galeriaPendientes) where I filter records from a SharePoint list (RetornoFlexible_1) by user. As I need to relate the records with the user, I use another list called "TablaEmpleados". The app relates the column "Legajo" from RetornoFlexible_1 with the USERID from TablaEmpleados, obtains the MANAGER from that record, then looks for the MANAGER in USERID column, obtains the email and finally compares it with the email from the user logged in the app

This is how the app filters those records:

Filter(
       AddColumns(
               AddColumns(
                        RetornoFlexible_1,
                        "ManagerID", LookUp(TablaEmpleados, USERID = Legajo, MANAGER)
               ),
               "ManagerEmail", LookUp(TablaEmpleados, USERID = ManagerID, EMAIL)
       ),
       ManagerEmail = User().Email
)

When the user selects one items, the app shows the details in an other page. The user has to complete some information and save changes which impact in my SharePoint list (RetornoFlexible_1). I use patch function for this however it fails with the following message: " The specified column 'ManagerEmail' does not exist". 

Patch(
     RetornoFlexible_1,
     galeriaPendientes.Selected,
     {JornadaLaboral: Value(dValorJornada.Text)},
     {Mes25: Value(dEtiquetaMes25horas.Text)}
);

 If I change the items property from my gallery to "RetornoFlexible_1" instead of using the filter formula, no errors are shown. I understand that the addcolumn function is causing trouble, however I don't know how to fix it. ¿Could you please help me?

 

Thank you in advanced!

1 ACCEPTED SOLUTION

Accepted Solutions
Highlighted
Super User III
Super User III

Hi @denise_martinca 

Sure!  Your patch needs to be more specific in identifying the record being patched.

 

 

Patch(
     RetornoFlexible_1,
     Lookup(RetornoFlexible_1, ID = galeriaPendientes.Selected.ID),
     {JornadaLaboral: Value(dValorJornada.Text)},
     {Mes25: Value(dEtiquetaMes25horas.Text)}
);

 

 

When the Items property of the gallery does not match the datasource in a form or Patch(), then a more specific way of identifying the record being patched is needed.  In this case, the ID of the record can be used in the patch.  BTW, this is a very common problem and it can be avoided by always using a lookup to a unique identifier of the record.  I always  use a lookup on forms and in Patches instead of the more generic Gallery.Selected in case the Item property of the gallery is altered in the future or if a collection is used for the gallery instead of a data source. 

View solution in original post

2 REPLIES 2
Highlighted
Super User III
Super User III

Hi @denise_martinca 

Sure!  Your patch needs to be more specific in identifying the record being patched.

 

 

Patch(
     RetornoFlexible_1,
     Lookup(RetornoFlexible_1, ID = galeriaPendientes.Selected.ID),
     {JornadaLaboral: Value(dValorJornada.Text)},
     {Mes25: Value(dEtiquetaMes25horas.Text)}
);

 

 

When the Items property of the gallery does not match the datasource in a form or Patch(), then a more specific way of identifying the record being patched is needed.  In this case, the ID of the record can be used in the patch.  BTW, this is a very common problem and it can be avoided by always using a lookup to a unique identifier of the record.  I always  use a lookup on forms and in Patches instead of the more generic Gallery.Selected in case the Item property of the gallery is altered in the future or if a collection is used for the gallery instead of a data source. 

View solution in original post

Highlighted

Thank you very much!!! Super useful 😊

Helpful resources

Announcements
Community Conference

Power Platform Community Conference

Check out the on demand sessions that are available now!

News & Announcements

Community Blog

Stay up tp date on the latest blogs and activities in the community News & Announcements.

secondImage

Power Platform 2020 release wave 2 plan

Features releasing from October 2020 through March 2021

Community Highlights

Community Highlights

Check out the Power Platform Community Highlights

Top Solution Authors
Top Kudoed Authors
Users online (2,431)