Action not executing

BobG
New Member

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?

Solved Solved
0 8 647
1 ACCEPTED SOLUTION

Please tryโ€ฆ
Select(WTLog[LogKey], [IssuedKey]=[_thisrow].[IssuedKey])

View solution in original post

8 REPLIES 8

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])

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])

BobG
New Member

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.

Youโ€™re welcome

Thanks guys - I was having the exact same problem and this fixed it! 

Top Labels in this Space