Failed: Error: 'Execute an Action on a Set of Rows'

Hello everyone,

I have a bot that is updating the data of some rows based on what was submitted via a form.

Everything worked so far, but recently after adding a few more things to the app, the update part stopped working.
I am getting the following error when executing an action from the test part of the automation bot:
"Failed: Error: 'Execute an Action on a Set of Rows' Data action 'Update Contor' for table 'Form_Data failed with exception Cannot get key values when Parent or ChangeImage are null."
Here's the code seen in the app:

Show More
{
"$type": "Nirvana.Data.TaskResultTakeAction, V2API",
"AppWorkflowRuleOrProcessName": "Gestionare Coffee",
"ActionName": "Update Contor",
"Changes": {
"$id": "1",
"$type": "ChangeOperations.Changes, ChangeOperations",
"ListChanges": [
{
"$id": "2",
"$type": "ChangeOperations.Change, ChangeOperations",
"AfterImage": [
"2",
"",
"03/30/2023 23:29:32",
"BRB - 161",
"",
"",
"",
"",
"Joi",
"",
"",
"",
" () ",
"",
""
],
"AfterImageOriginal": null,
"BeforeImage": null,
"BeforeImageOriginal": null,
"ChangeImage": null,
"ChangeImageToLog": [],
"ChangeImageSavedImages": null,
"ProcessStateDataChange": null,
"InputParamValues": null,
"MustReadBeforeOrAfterImage": false,
"OpTypePerformed": "Update",
"TableName": null
}
]
},
"AppErrors": {
"$type": "Jeenee.DataTypes.AppErrors, Jeenee.DataTypes",
"RecordInfo": false,
"RecordWarning": true,
"AnnotateErrors": false,
"Errors": []
},
"TaskType": "TakeAction",
"TaskName": "18be6d4a-d972-4bc0-96b7-79f41f0cdec7-Update Contor"
}

I had this issue in the past with a different app, but I don't remember if I did something to fix it or was fixed by itself.

Do you have any idea what can cause this error?

Let me know if you need to see any of my actions or tables.

Thanks in advance!
Razvan

0 11 1,131
11 REPLIES 11


@RazvanS wrote:

Cannot get key values when Parent or ChangeImage are null."


I would start by looking at this part of the message.  Are "Parent" and "ChangeImage" columns?  Are they null?

Since this message is being shown in an "Execute an Action on a Set of Rows' Data action" I would look at the expression in the "Referenced Rows" part of the action.  Is it properly selecting rows to operate on?

 

No, Parent and ChangeImage are not columns in my tables.

Here is my action:

I'm not sure what is happening, but suddenly the app is not finding the data from the spreadsheet, I feel like that is causing the errors, since the ref rows are empty, so the value is null.
I'll double check this and see if it fixes my problem.

How is the column [Serie Scurta] defined?  The way you are using it in the action, It MUST be a column that is a list of Row Keys.

FYI, you do not need the [_THISROW] keyword in this context for the Referenced Rows, though I don't think it harms anything.

[Serie Scurta] inside [AUTOMATE_BEBE] is this one:

This one also has a formula for "Suggested values" to return data only for the currently selected day in the form

So, the [Serie Scurta] column is key in both, though from what I know it shouldn't be inside the form as well, since a specific key can exist more than once and that is not allowed.

I figured that I didn't need the [_THISROW] part, I copied most of the syntaxes from a similar app I have that works almost the same as this one.

I'm not sure what is causing the error, checking all the actions one by one, the results are correct, the required data is correctly selected, but the bot is having trouble finding the data and updating it.

Based on your screenshot of the [Serie Scurta] column it is NOT marked as the Key column for that table.  This is why you are seeing an error.  The action is attempting to pass a list of  NON-key values - which is invalid.

I can't tell you how to fix it since we don't have enough details about your app table setup.

Either you need to provide more details about your app setup AND what you are trying to accomplish with the problem action  OR  you can refer to this article to get a betting understanding of how Ref/Key columns are meant to work between tables.

References Between Tables

This is what I have:
- a form, table called "Form_Data" that stores all the data submitted via the form

- a table that needs to update based on the data submitted using the above form

The main part of these is the [Serie Scurta] column which is basically a Serial Number which I wanted to use as a common factor between the tables so everything updates where that specific value is found.

[Serie Scurta] IS marked as Key in the main table [AUTOMATE_BEBE], but not in the form [Form_Data].

My question is - can the key in the form table contain duplicate values? since the table will store multiple times a specific key value. From what I read the key needs to be unique.


@RazvanS wrote:

[Serie Scurta] IS marked as Key in the main table [AUTOMATE_BEBE], but not in the form [Form_Data].


In your action, the [_THISROW] keyword is referring to the Form_Data table, so when you use this expression: "LIST([_THISROW].[Serie Scurta])"   you are simply creating a LIST of that text value - it is not a list of reference values.

The Referenced Rows property needs to be given a LIST of row reference values (i.e. row keys) from the REFERENCED TABLE table.  In your case, because [Serie Scurta] column is the key column of the Referenced Table "AUTOMATE_BEBE",  that expression needs to be:

SELECT(AUTOMATE_BEBE[Serie Scurta],[Serie Scurta] = [_THISROW].[Serie Scurta])

or you can simplify it like this:

FILTER("AUTOMATE_BEBE", [Serie Scurta] = [_THISROW].[Serie Scurta])

 I hope this helps!

I tried your variants, sadly nothing changed, the bot still gives the same error.
I'm not sure why this "LIST([_THISROW].[Serie Scurta])" won't work, I am using the same logic that I have here:
Devices Data:

Show More
RazvanS_0-1681213918063.png

The equivalent to [AUTOMATE_BEBE] from the app I am working on right now

Proces Verbal:

Show More
RazvanS_1-1681213989791.png

The equivalent of [Form_Data] from the app I am working on right now

The form Proces Verbal is updating the values in Devices Data.

An example of action that works:

I am currently using this app and it works as it is.
In the form I select the serial number and an owner and the data updates in Devices Data.

As I mentioned before, I copied most of the action syntax from this one and I had no issues until recently, but I don't think it's the syntax of the action itself because it worked before without making any changes to the current actions, just added new ones.

Do you think it's possible we can have a meet and I can show you what I have? should be better honestly, I'm already out of ideas to try.
Thanks for all the help so far!


@RazvanS wrote:

I'm not sure why this "LIST([_THISROW].[Serie Scurta])" won't work,


Actually, my mistake.  It will work - most of the time.  I guess I am so use to using dedicated key columns I wasn't making the connection that the value you are passing IS a Row Key in the OTHER table.

So sorry for the confusion!!

HOWEVER, this implementation assumes that the Form_Data value does appear in your other table as a row key.  If you are confident that the 2 tables are in Sync then your method will work.  If you are not confident, then using one of the expressions I provided will prevent an error in the event the value in Form_Data doesn't actually exist as a row in the other table.  It will result in zero rows found and prevent the "sub-action" from being called.

Now that I am embarrassingly on the same page as you with your action, let's return to the error. 

So, reviewing the original content deeper, I wonder if your Form_Data row has all the columns properly populated.  See image below.  If I am reading your log entry correctly, it seems to imply that the key column of the supplied Form_Data row is blank.  Have you reviewed the row in the datasource?

Also, how are you creating the Form_Data row and sending it to the "Update Contor" action?  Are you using API, by chance?

Row data from Form_Data table passed to Action?

Screenshot 2023-04-11 at 12.21.42 PM.png

I THINK I fixed it, and I was 100% sure I updated this, but it seems my double check really needed a triple check.

My latest update was adding the location of the specific serial number at the end (e.g. BRB - 161 ([Location Name]), but the name of the column wasn't really EXACTLY the same in both tables.
I had [Serie Scurta] containing only BRB - 161 in the [AUTOMATE_BEBE] table, but in the form the [Serie Scurta] column contained this value BRB - 161 ([Location Name])

I am still double checking, but I did some form submissions and it updated properly.
Oh and I'm not using any API, just default AppSheet.

In my experience, when it isn't obvious what the problem is, it usually some small silly think that is easily overlooked!!!

Glad you found the problem!

Top Labels in this Space