Hi @Anonymous ,
Do you want to update multiple records if their checkboxes are checked?
Could you tell me these fields' data type:COD_FILIAL_PRODUTO, DATA_EMISSAO and GERENCIA?
1/Some sql data type are not supported in powerapps, which will cause some problems.
Power Apps data type mappings
Note
If a SQL Server data type is not listed in the table above, it is not supported. Examples of unsupported SQL Server data types include: binary(), varbinary(), image, cursor, rowversion, hierarchyid, sql_variant xml, Spatial Geometry Types, Spatial Geography Types, and table.
Make sure that GERENCIA is text type.
2/What's more, do not need to rename so many fields, you just need to rename those used for comparing.
You could also try patch function instead of updateif function.
Try this:
ForAll (
RenameColumns (Filter (Descarte_Gallery_2.AllItems; Checkbox1.Value = true);
"COD_FILIAL_PRODUTO"; "COD_FILIAL_PRODUTO1";"DATA_EMISSAO";"DATA_EMISSAO1"
);
Patch('[dbo].[E_DESCARTES]';
LookUp('[dbo].[E_DESCARTES]';COD_FILIAL_PRODUTO = COD_FILIAL_PRODUTO1;
DATA_EMISSAO = DATA_EMISSAO1
);
{GERENCIA: "APROVADOos"}
)
)
3/Direct date filters do not work for SQL Server. However, you can create a calculated column that will work. For instance, ALTER TABLE myTable ADD DateAsInt AS (YEAR([date]) * 10000 + MONTH([date]) * 100 + DAY([date])) and then filter on the calculated number column.
4/Make sure you have primary key in your sql table.
Or else this sql table will be read-only in powerapps.
To sum up, sql table has many limitations in powerapps. Here's a doc about this, please check one by one:
https://docs.microsoft.com/en-us/connectors/sql/
I also notice that you posted a same issue here:
https://powerusers.microsoft.com/t5/Building-Power-Apps/update-with-checkbox-on-gallery/td-p/572999
You add an very important information there:
it working only with the firts 15 day after this no make update.
So I think the key problem should be about delegation.
My opinion about delegation is there, please check that.
Best regards,