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

Patch a collection to Sharepoint using disambiguation

Hello.

 

I work on a sells department and there is an amout of boxes in the warehouse that leaves the company. I had no problem when my database was on OneDrive, but recently I migrated to SP because of the delegation limit. Currently my source has 2050 rows.

 

This is my code:

Spoiler
If(
Login_Actor_Cargo.Text = "Supervisor";
ForAll(
Colección_POS_En_Carrito; ***my collection
Patch(
Inventario_POS***my database
LookUp(
Inventario_POS***my database
Código ***the column on my database = Colección_POS_En_Carrito[@Código] ***This is where the delegation warning starts
);
{
Agencia: "Sin reasignar";

'Fecha de disposición': Login_Anexo_Hoy.SelectedDate;
Responsable: Login_Actor_Nombre.Text;
'DNI responsable': Login_Actor_Documento.Text;
'DNI supervisor': Login_Actor_Documento.Text;
'Nombre supervisor': Login_Actor_Nombre.Text;
Departamento_R: Login_Actor_Departamento.Text;

Ubicación: "En campo";
'Doble check': "No está en inventario"
}
)

 

The delegation warning I get is:


Delegation warning. It is possible that the "LookUp" part won't work
The highlighted part of this formula may not work correctly with the "Colección_POS_En_Carrito.Código" column in a large data set.

 

What I'm trying to accomplish is to patch every single record on my collection (wich may vary) to sharepoint.

 

Any help is welcome and thanks beforehand. I have learned a lot reading forums and this is the first time I culdn't find an answer.

1 ACCEPTED SOLUTION

Accepted Solutions
Highlighted
Super User III
Super User III

Re: Patch a collection to Sharepoint using disambiguation

@RenzoR 

Yes, you will have delegation issues with that formula.  

If I understood your description and logic properly, consider this as a replacement for your formula:

If(
  Login_Actor_Cargo.Text = "Supervisor";
  ForAll(
    RenameColumns(Colección_POS_En_Carrito; "Código"; "POSCódigo"); 
    UpdateIf(
        Inventario_POS; 
        Código=POSCódigo;
        {      
           Agencia: "Sin reasignar";
           'Fecha de disposición': Login_Anexo_Hoy.SelectedDate;
           Responsable: Login_Actor_Nombre.Text;
           'DNI responsable': Login_Actor_Documento.Text;
           'DNI supervisor': Login_Actor_Documento.Text;
           'Nombre supervisor': Login_Actor_Nombre.Text;
           Departamento_R: Login_Actor_Departamento.Text;
           Ubicación: "En campo";
           'Doble check': "No está en inventario"
    }
  )
)

 

See if that is better for you or if you still experience a delegation issue.

 

I hope it is helpful.

_____________________________________________________________________________________
Digging it? - Click on the Thumbs Up. Solved your problem? - Click on Accept as Solution. Others seeking the same answers will be happy you did.

View solution in original post

3 REPLIES 3
Highlighted
Super User III
Super User III

Re: Patch a collection to Sharepoint using disambiguation

@RenzoR 

Yes, you will have delegation issues with that formula.  

If I understood your description and logic properly, consider this as a replacement for your formula:

If(
  Login_Actor_Cargo.Text = "Supervisor";
  ForAll(
    RenameColumns(Colección_POS_En_Carrito; "Código"; "POSCódigo"); 
    UpdateIf(
        Inventario_POS; 
        Código=POSCódigo;
        {      
           Agencia: "Sin reasignar";
           'Fecha de disposición': Login_Anexo_Hoy.SelectedDate;
           Responsable: Login_Actor_Nombre.Text;
           'DNI responsable': Login_Actor_Documento.Text;
           'DNI supervisor': Login_Actor_Documento.Text;
           'Nombre supervisor': Login_Actor_Nombre.Text;
           Departamento_R: Login_Actor_Departamento.Text;
           Ubicación: "En campo";
           'Doble check': "No está en inventario"
    }
  )
)

 

See if that is better for you or if you still experience a delegation issue.

 

I hope it is helpful.

_____________________________________________________________________________________
Digging it? - Click on the Thumbs Up. Solved your problem? - Click on Accept as Solution. Others seeking the same answers will be happy you did.

View solution in original post

Highlighted
Frequent Visitor

Re: Patch a collection to Sharepoint using disambiguation

It worked like a charm! Thank you so much!

 

So, disambiguation operators wont work with SP?  Was having the same name "Código" (on my collection and on the SP list) the real problem?
I will study more the effects of rename columns and update. Thank you again 👍

Highlighted
Super User III
Super User III

Re: Patch a collection to Sharepoint using disambiguation

@RenzoR 

The disambiguation and delegation are hand in hand the issue here. 

It does stem from the fact that you have columns of the same name (not normally and issue).  In order to reference the proper one, you need to utilize disambiguation.  That is all perfectly fine...except...

...The problem is that your original formula would have to "calculate" (and I use this term for simplicity) based on disambiguation from the outer collection in the ForAll.  Any time you have a calculation going at a formula like that, you will have delegation warnings.  The trick is to "cement" them into a variable.  In this case, Renaming the column is sufficient because we're actually removing the need to use disambiguation and thus removing the calculation, and thus removing the delegation warning.  We could have also Added a column to the ForAll - thus "cementing" the value into something that doesn't need a calculation. 

 

NOW...remove all of the datasources from your formula and use collections instead and you would not have had the issue and it would have worked - but that is not what you needed.  I only mention that to put your fears to rest that disambiguation doesn't work - it does.

_____________________________________________________________________________________
Digging it? - Click on the Thumbs Up. Solved your problem? - Click on Accept as Solution. Others seeking the same answers will be happy you did.

Helpful resources

Announcements
Community Conference

Power Platform Community Conference

Check out the on demand sessions that are available now!

Watch Now

Experience what’s next for Power Apps

See the latest Power Apps innovations, updates, and demos from the Microsoft Business Applications Launch Event.

Power Platform ISV Studio

Power Platform ISV Studio

ISV Studio is designed to become the go-to Power Platform destination for ISV’s to monitor & manage published applications.

secondImage

Power Platform 2020 release wave 2 plan

Features releasing from October 2020 through March 2021

Tech Marathon

Maratón de Soluciones de Negocio Microsoft

Una semana de contenido con +100 sesiones educativas, consultorios, +10 workshops Premium, Hackaton, EXPO, Networking Hall y mucho más!

Top Solution Authors
Top Kudoed Authors
Users online (6,850)