Hi all, Iโm receiving the below error in one of my apps.
**โErrorsโ: "Error: Perform DataAction **
โSign Off Approval Sentโ failed because Row having key โPOR126765-001โ in table โAccountsโ containing value โโ in field โAccounts Comments to Directorโ failed โRequired_Ifโ condition. Error: โSet Column Valuesโ Data action โSign Off Approval Sentโ failed with exception Collection was modified; enumeration operation may not execute.
I have a workflow that sends an email with a PDF report.
This is for an approval process.
The workflow should only be triggered when there are adds and updates; based on the condition there has not been a previous email sent for that record.
So when you need something approved, you select that โSign Off is Requiredโ and input any commentary you like.
When saved the workflow is triggered and checks to see if Sign Off Sent = N.
If it is N then it will send the workflow and update the column to Y (Yes).
If I went in to edit that record again, nothing would be sent as the Y value does not match the condition.
However, in this app I saw two emails go out one with the correct data and the second one was blank. This second emails should not have went out as it was already previously sent and should have updated.
Here is the action to change data from N to Y.
There are no conditions on this action.
Here is the workflow rule condition
The column required if as stated in the error is the below formula.
AND([Sign Off Required]=โSign Off Requiredโ,
ANY(Current_User[User Role])=โAccountsโ
)
I should mention this process seems to be working on other apps okay, and we checked them for comparison so not sure what the issue is.
How do you fire the action to change the flag from N to Y?
On save form event or part of workflow?
Yeah the workflow has two actions, when the workflow is sent the second action is the change data.
Not upon saving no
I m thinking the action to change the value to Y is done first. Then the validation and conditions check to send email is evaluated, the value is already changed to Y, so not firing the email action.
Okay - how would appsheet do that when the workflow is not ordered in such a way?
Iโm not having an issue with emails not sending its that the email is being resent.
So when it is first fired it changes the condition from N to Y. However that data change isnโt happening due to the error above but I donโt fully understand that error
Just to check if it gets through.
Just fire action to make the value N to Y by on save form condition? and remove from workflow action. Then this action will be only fired when the value is N.
I thought the form data is going to be sent. And triggers workflow. At the time when the workflow to run, the value for that column could be N, then send the email, else do nothing.
I see what youโre saying but the form could be saved for number of reasons so I only want that action to be triggered under the conditions of the workflow.
It seems to work as a process but due to the error received that action is not being fired
You have conditions to run the workflow. I reckon you just simply apply the same condition to your action to fire on save form. That should be equal.
Iโm going to test it out and see how it goes, thank you for the suggestion
You say this:
But the error says this:
Based on the error, the comment IS required - not optional - and since the value entered by your action into that field is โโ that doesnโt satisfy your requirement.
Try changing the commentโs required setting to either NOT required, or use something like:
context(โViewTypeโ) = โFormโ
That way things are only enforced inside the form, and any actions that modify things wonโt cause this sort of error.
โฆor just put something in the comment (^_^)
Hard to parse through these error codes some timesโฆ
Item | Specifics |
---|---|
Action that Failed | โSign Off Approval Sentโ |
Row attempted to modify | key โPOR126765-001โ in table โAccountsโ |
Column that caused failure | field โAccounts Comments to Directorโ in table โAccountsโ |
Value that caused error | โโ |
Reason for error | failed โRequired_Ifโ condition |
Yeah we were struggling to understand the failure here.
The comments initial value is set to โโ - blank. They are required when any sign off is being sent.
When they input the comments it gets sent to a history (another column that logs previous notes). When you go into the form to edit it is then reset. (Reset on edit is enabled)
Is it due to this reset/blank value that you think it is failing? Because it appears to work on all our test apps this way
Iโve run into problems with data-change actions where I mark something as โCompleteโ or something, but there will be required columns that I wasnโt thinking about that caused similar errors.
For example:
I have a form with a โNavigation Buttonโ at the bottom of the form;
Iโve got that nav enum as the last option in the field, and the form set to auto-save, so when they tap the option they want the form automatically saves and navigates to their selected option.
Butโฆ since this nav enum is marked as required, if I mark something as complete with an action - this nav action isnโt being setโฆ and therefore I had an error similar to what youโre seeing.
User | Count |
---|---|
43 | |
30 | |
24 | |
23 | |
13 |