Failed Change Data Workflow

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.

1 Like

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.

1 Like

I’m going to test it out and see how it goes, thank you for the suggestion :slight_smile:

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 (^_^)

1 Like

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

Yes, I think it’s due to the requirement and the field being blank.

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;

  • Users select the option they want to do, instead of just hitting the save button, and a form save event action launches an appropriate nav action.

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.

1 Like