Hi all
I have an app to bulk update items (sharepoint list as data)
I have the formulas:
Gallery with checkbox items: Filter(PlanProjetos; Analise = "Aguardando Aprovação")
onCheck : Collect(colupdatesPlan;ThisItem)
onUnCheck: Remove(colupdatePlan;thisitem)
Save button:
UpdateIf(colUpdatesPlan;true;{Analise: "Aprovado";Aprovador: User().Email});;
Patch(PlanProjetos;colUpdatesPlan);;
It worked fine but now is showing error and don't save updates. The error is "the specified column is read-only and can't be modified"
What I need to change? How to collect only certain columns with "Thisitem"? and Remove if necessary?
Thanks
Solved! Go to Solution.
This is because you changed the primary key! It was ID and should be ID (assuming this is a SharePoint list).
Formula should be:
Patch(PlanProjetos;
ForAll(Filter(galPlanos.AllItems; Checkbox1_2.Value);
{ID: ID;
Analise: "Aprovado";
Aprovador: User().Email
}
)
)
If you omit the primary key (ID), then patch will create a new record.
Also, no need to check if a value is true or false that is already a true or false value (Checkbox1_2.Value)
Again, the ID is the primary key for a SharePoint list, so if you are using another datasource, then let me know.
Why bother collecting and duplicating the data? You already have what you need in the Gallery.
Your formula should be based on the Checkbox filter and it would look like this:
Patch(PlanProjetos;
ForAll(Filter(yourGallery.AllItems; yourCheckbox.Value);
{ID: ID;
Analise: "Aprovado";
Aprovador: User().Email
}
)
)
No collections needed! Nor OnSelect actions of checkboxes.
The above formula also assumes that your Aprovador column is a text column.
I hope this is helpful for you.
Hi
Put this :
Patch(PlanProjetos;
ForAll(Filter(galPlanos.AllItems; Checkbox1_2.Value = true);
{IDProj: IDProj;
Analise: "Aprovado";
Aprovador: User().Email
}
)
but instead of change the record, its creating a new one with IDPRoj, "Aprovador" and "Analise"
This is because you changed the primary key! It was ID and should be ID (assuming this is a SharePoint list).
Formula should be:
Patch(PlanProjetos;
ForAll(Filter(galPlanos.AllItems; Checkbox1_2.Value);
{ID: ID;
Analise: "Aprovado";
Aprovador: User().Email
}
)
)
If you omit the primary key (ID), then patch will create a new record.
Also, no need to check if a value is true or false that is already a true or false value (Checkbox1_2.Value)
Again, the ID is the primary key for a SharePoint list, so if you are using another datasource, then let me know.
The first Microsoft-sponsored Power Platform Conference is coming in September. 100+ speakers, 150+ sessions, and what's new and next for Power Platform.
This training provides practical hands-on experience in creating Power Apps solutions in a full-day of instructor-led App creation workshop.
User | Count |
---|---|
182 | |
47 | |
46 | |
34 | |
33 |
User | Count |
---|---|
260 | |
87 | |
79 | |
68 | |
67 |