Cannot get key error when using list of refs in a bot

For reasons I don't understand, I cannot use the value of an enumlist field with a ref base as the list of referenced rows in a bot.  The calculation is validated, but in testing the bot, I get this error:
Failed: Error: 'Execute an Action on a Set of Rows' Data action 'Mark Invoices as Paid Action - 1' for table 'payments failed with exception Cannot get key values when Parent or ChangeImage are null.  The table seems to be holding the right values in the [related_invoices] field.  I see those keys in the table.  I've tried using a select( In()) statement but that didn't help.  

Screen Shot 2024-03-18 at 11.49.19 PM.png

Screen Shot 2024-03-18 at 11.46.13 PM.pngScreen Shot 2024-03-18 at 11.45.34 PM.png

What's going on?

0 13 141
13 REPLIES 13

If understanding of your requirement is correct, please try a referenced rows expression of 

SELECT(Invoices2[Key column of Invoices2 Table], IN([Key column of Invoices2 Table],  [_THISROW].[related_invoices] ))

Thanks. I did try that and just tried it again. No change in the result.
Same error message.

Thank you. The error could be to do with the parent table. You may want to elaborate 'Cannot get key values when Parent or ChangeImage are null." 

Is ChangeImage ( and possibly Parent ) some column in the parent table?

No, these are not column names. I assume itโ€™s a standard error message.
Related Invoices is a typical Ref_Row virtual column so Invoices2 is a
parent table to the payments table. The ids shown in the table preview
picture are correctly pointing to invoice2 rows.

Sorry, correction: [Related Invoices] is a EnumList with a base of ref, and pointing to the invoices2 table. 

Here's a potential clue: even when I change the referenced rows to List(7e3fce99, aserf299), I get the same result.  So the problem doesn't seem to be related to the referenced row values.  

 

More clues: Even a new app, using a new database generates the same sort of error.  Is it not allowable to have a bot triggered by a change in Table A to then start a process to update rows in Table B?

@Suvrutt_Gurjar tagging you on this real quick.

Since this is an EnumList column of type REF a lot of us have talked about 'flattening' an EnumList to make it a List instead. I believe the formula you want to use in the referenced rows section is the following, but someone else correct me, and let us know if this solves your problem:

SPLIT(TEXT([related_invoices]), ",")

Thanks Marcus, I suspected something similar, but no, that's not it.   Same error message.  I've even tried Invoices2[id] and List(7e3fce99, aserf299).  The problem doesn't appear to be related to identifying a list at all.   I'm still wondering whether it's simply not possible to have a bot initiated by one table change acting on another table.


@Markus_Malessa wrote:

lot of us have talked about 'flattening' an EnumList to make it a List instead


 

Hi @Markus_Malessa , thank you for tagging. However I believe flattening the list is not necessary here. A list flattening is required when it is a list of list meaning something like SELECT( Table_Name[Enumlist Column]......) . In this case it is a single row, so flattening is not required.

@RedVox ,

You may want to take a look at the following post thread for any clues to the issue.

Failed: Error: 'Execute an Action on a Set of Rows... - Google Cloud Community

 

 

Thanks, yes I did review that posting before posting.  I don't see a solution in there.  Ultimately, I decided to just create an appscript.  It is working fine with the same list values.  Still, very curious about why this didn't work, why it didn't raise any validation issues in formula editor and why the error it generates in test is so cryptic.   

Good to know that you could solve it.  

Regarding this behavior, since it is a rare occurrence, I believe further insights can be given only with substantial more details such as taking a look at the app which may be beyond community's purview. 

Someone else from community could offer insights or you may want to communicate with AppSheet support.

Thanks for your time considering this issue.  I've reported it as a bug (for what it's worth).

Top Labels in this Space