cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
denise_martinca
Helper II
Helper II

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
Drrickryp
Super User
Super User

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
Drrickryp
Super User
Super User

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

Thank you very much!!! Super useful 😊

Helpful resources

Announcements
UG GA Amplification 768x460.png

Launching new user group features

Learn how to create your own user groups today!

Community Connections 768x460.jpg

Community & How To Videos

Check out the new Power Platform Community Connections gallery!

Welcome Super Users.jpg

Super User Season 2

Congratulations, the new Super User Season 2 for 2021 has started!

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.

Users online (1,307)