I'm noticing there are sporadic instances where button initiated commands will fail to execute in its entirety. The issue appears to be random and not tied to a specific error. I tried using Monitor to see if a portion of the code is failing but the portion that doesn't execute never shows up. See the code below as an example. While a portion of the code will execute as intended, another portion, say one of the Patch commands, will not. This throws off the entire workflow of the app. It's not limited to a specific portion of the code. It may be the first patch command that doesn't run in one instance but then the 2nd patch command doesn't run in another instance. There doesn't appear to be a specific pattern. 9/10 times the app works fine but I'm seeing more and more instances where something didn't execute as intended. This app is used by a large number of users (>500) and I didn't notice these problems when only used by a small number of users. Has anyone else run into similar issues? Any suggestions on a resolution?
Example code executed by button click:
Set(
varLoading,
true
);
Patch(
Approvals,
LookUp(
Approvals,
And(
'Approval Role' = "EOS",
SSDID = Value([@SSDID].Text),
'Workflow Step' = "Initiation",
Status = 1
)
),
{'Approval Date': Now()}
);
Patch(
Approvals,
LookUp(
Approvals,
And(
'Approval Role' = "EOS",
SSDID = Value([@SSDID].Text),
'Workflow Step' = "Initiation",
Status = 1
)
),
{'Approval Status': "Approved"}
);
ClearCollect(
ApprovalInfo,
All
);
Collect(
ApprovalInfo,
Filter(
Approvals,
'Workflow Step' = "Initiation",
SSDID = Value([@SSDID].Text)
)
);
If(
Value(Label8.Text) = 0,
Patch(
'SSD List Master',
LookUp(
'SSD List Master',
SSDID = Value([@SSDID].Text)
),
{Status: "Approved"}
)
);
Set(
varLoading,
false
);
Navigate('View Pending Approval-2')
Can we simplify these steps?
Set(
varLoading,
true
);
Patch(
Approvals,
LookUp(
Approvals,
And(
'Approval Role' = "EOS",
SSDID = Value([@SSDID].Text),
'Workflow Step' = "Initiation",
Status = 1
)
),
{
'Approval Date': Now(),
'Approval Status': "Approved"}
);
ClearCollect(ApprovalInfo,
Filter(
Approvals,
'Workflow Step' = "Initiation",
SSDID = Value([@SSDID].Text)
)
);
If(
Value(Label8.Text) = 0,
Patch(
'SSD List Master',
LookUp(
'SSD List Master',
SSDID = Value([@SSDID].Text)
),
{Status: "Approved"}
)
);
Set(
varLoading,
false
);
Navigate('View Pending Approval-2')
Thanks, Stalin
Blog - Learn To Illuminate Blog
YouTube - Learn To Illuminate Videos
WarrenBelz
637
Most Valuable Professional
stampcoin
570
Super User 2025 Season 2
Power Apps 1919
473