cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
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
Super User II
Super User II

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

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
New Badges

New Solution Badges!

Check out our new profile badges recognizing authored solutions!

New Power Super Users

Congratulations!

We are excited to announce the Power Apps Super Users!

Power Apps Community Call

Power Apps Community Call: February

Did you miss the call? Check out the Power Apps Community Call here.

Microsoft Ignite

Microsoft Ignite

Join digitally, March 2–4, 2021 to explore new tech that's ready to implement. Experience the keynote in mixed reality through AltspaceVR!

Top Solution Authors
Top Kudoed Authors
Users online (96,229)