hello, I made an app on power apps and on a canvas I control 2 values of data who are linked between them.
this is what i have :
I make 2 function, one for when I enable the switch button and for when I disable the switch button
on check :
Patch(
WaitingExecutionStepsCollection;
First(
Filter(
WaitingExecutionStepsCollection;
SK = ThisItem.ParentExecutionStepSK
)
);
{ValidationStatus: true}
)
on uncheck :
Collect(
StepCollection;
Filter(
WaitingExecutionStepsCollection;
ParentExecutionStepSK = ThisItem.SK
)
);;
If(
ThisItem.SK = uncheckStart;
Patch(
StepCollection;
Defaults(StepCollection);
ThisItem
)
);;
If(
IsBlank(
Filter(
WaitingExecutionStepsCollection;
ParentExecutionStepSK = ThisItem.SK
)
);
ForAll(
StepCollection;
{ValidationStatus: false}
)
);;
UpdateIf(
WaitingExecutionStepsCollection;
!IsBlank(
LookUp(
RenameColumns(
StepCollection;
"SK";
"SK1"
);
SK1 = SK
)
);
{ValidationStatus: false}
)
on select :
Set(
uncheckStart;
ThisItem.SK
);;
Patch(
WaitingExecutionStepsCollection;
ThisItem;
{ValidationStatus: tg_Status.Value}
);;
Clear(StepCollection)
on change :
UpdateIf(
Filter(
WaitingExecutionStepsCollection;
ProcessingType = "Error" && RootFailedSequenceSK = ThisItem.FailedSequenceSK
);
true;
{ValidationStatus: tg_Status.Value}
);;
With this when I put true for a data, all the parent has their value put in true but when I make false, I have a problem, just the last children are put in false or I have an infinite loop in the first parent or nothing change. I see that the value change because the switch button change of value, but my apps change the value just after (that cause a loop sometime)