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.

0 12 291
12 REPLIES 12

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

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.

Top Labels in this Space