I'm trying to use IfError() function to figure out its functionality. I have a simple example where I use ClearCollect() as below (in a onSelect() of a button). Not sure what I'm doing wrong but only the first ClearCollect() executes and the collection colTempS4_1 has data, and the collection colTempS4_2 remains empty.
After the code execution:
colTempS4_1 has correct data,
colTempS4_2 has correct data,
colTempS4_3 remains empty,
varTempS4_4 remains empty,
varTempS4_5 remains empty,
varTempS4_6 has correct data,
varTempS4_7 has correct data
(The collections have not been used elsewhere in the app. Formula-level Error Management was also on in the app.)
With({K:0},
With({K1:ForAll(Sequence(10) As I,K+I.Value),K2:ForAll(Sequence(10) As I,K+1+I.Value)},
IfError(
ClearCollect(colTempS4_1,K1),Notify("Error-1",Warning,1000);false,
ClearCollect(colTempS4_2,colTempS4_1),Notify("Error-2",Warning,1000);false,
ClearCollect(colTempS4_3,K2),Notify("Error-3",Warning,1000);false,
Set(varTempS4_4,K1),false,
Set(varTempS4_5,K2),false,
true
);
Set(varTempS4_6,K1);
Set(varTempS4_7,K2)
)
)
When I check the app monitor, the diagnostic shows that the third ClearCollect() executed and collected 1 row. Either way, all the collections/variables should have contained the same number of rows, and none should remain empty