Action not executing

I have a Child table with a Ref to the Parent table. I have an action on the child table that executes properly. On the Parent table I have an action (Execute an action on a set of rows) referencing the action on the Child table that is not working. Both tables have a columns with the same log key referenced in the formula.I suspect the Referenced Rows formula is bad.

Select(Log[LogKey], ([LogKey] = [_THISROW].[LogKey]))

Any idea on why this is not working?

What is the name of child table and what is the key of the child table?

It should follow this format.

select(childTable[childKey], [parentKeyReferenceInChild]=[_thisrow].[parentKey])

1 Like

Rich, thanks for the reply.

Referenced Rows formula
Select(WTLog[IssuedKey], [IssuedKey]=[_thisrow].[IssuedKey])

I modified your suggested formula and though, when testing the formula, I get different results than previous formulas I tried It still doesn’t trigger past the Parent table Action Button.

The action being call on the Child table work perfectly. I displayed the action button for the Child table and ran it from the WTLog (Child) main view & detail view. I’ve tried creating a new action on the Parent table using the same formula and parameters. No results.

The Parent table key is the IssuedKey column. The WTLog table has a key named LogKey and a column that contains the IssuedKeys from the Parent table. Would this have an impact on the formula to use?

The “WTLog” (Child) table IssuedKey column is also the Ref to the “Issued” (Parent) table. Would this set up have anything to do with it not working?

I’m no pro at programming but this seems like it should almost be automatic when there’s a relationship between tables. Any help would be immensely appreciated.

Please try…
Select(WTLog[LogKey], [IssuedKey]=[_thisrow].[IssuedKey])

1 Like

A million thanks Aleksi. It works!!

I’m wanting to understand why it worked and the others didn’t. Is it because the table key must be used in the first part of the Select() statement to get the related rows list?

I didn’t see that little detail mentioned anywhere in all of the doc, videos, or messages I viewed.

When you reference the child table you need to create a list of child table keys in the child table that AppSheet will apply the action to.

Logically AppSheet will do this:

  1. Perform the select query and get a list of values.
  2. Start at the top of the list and apply the referenced action to each key found in the child table.
  3. If it can’t find any keys then no actions will be applied.

Does that help?

Yes. It’s good to know how the flow works now. Aleksi messaged the Referenced Rows formula that works. I didn’t have the actual log key for the child table in the select formula. I thought you could use any column in the table.

Thanks for the info.

1 Like

You’re welcome