Check if there is one child record satisfying a requirement

I am getting a warning from AppSheet, saying that my queries might affect performance…

When you write “Related Tablenames”, do you mean just the table names? Or do you actually mean the word “related”?

SPecifically, what would this one translate into?

ISNOTBLANK(
  FILTER("Grants Submitted",
    AND(
     [Grant Deadline ID]=[_THISROW],
     ISBLANK([Submitted On])
  )
)

SELECT() - AppSheet Help

Because a specific column must be identified for the return value list.

Build list dereferences - AppSheet Help

The row numbers of the rows matched by the selection.

2 Likes

Thanks Steve. I was confused by this: https://support.google.com/appsheet/answer/10108207?hl=en since they never, in that page, mention that dataset-name can be a list, rather than a table…!

2 Likes

This is @Steve 's magic, guys.

4Aj2.gif

2 Likes

LOL I was just reading another topic when I saw @Suvrutt_Gurjar reply. Looking at his use of INTERSECT() I wonder whether this would work as well as all the other methods.

INTERSECT([Grants Submitted][Submitted On],LIST())>0

Where TRUE indicates there are blank dates and FALSE indicates no blank dates.

Does INTERSECT() work with blank lists?

Yes, you can do SELECT( [Related xxx][column] , condition ).

3 Likes

Only one quick note Steve.

I asked this:

@mercmobily2 wrote:what does [Grants Submitted][_ROWNUMBER] actually mean, syntactically

You answered with a link to “Build list dereferences - AppSheet Help”

But! Reading the docs, I fund this. Note that “Although identical in appearance to a column list expression, this argument is not an expression.”

  • dataset-column - The specification of the table or slice (the “data set”) to search and the column from which values are to be gathered, in the form: dataset-name[column-name]. For example, Orders[Order ID]. Although identical in appearance to a column list expression, this argument is not an expression.

Does that meant that that “[Grants Submitted][_ROWNUMBER]” is kind of special syntax for the Select =() function, rather than a Dereferencing expression? Please note that I am not trying to diminish or criticise your AMAZING response, for which I am immensely grateful!

Also, did you put in _ROWNUMBER just to satisfy what Select() is expecting, effectively? Meaning, it’s not really used for all intents and purposes… right?

Correct. The first argument of SELECT() identifies the rows in which to search and the column of the matching rows to return. The first argument of SELECT() is specified using familiar syntax available elsewhere in expressions, but the first argument of SELECT() is not itself interpreted as an expression.

Correct, in this case. You have to identify both a row set and a column for SELECT(). The _ROWNUMBER column is common to all row sets, and will always contain a value (a distinct value no less!), making it a good choice for examples and in practice.

1 Like

Hi Steve,

Am I right in saying that if the selected column is a ref (in this case the ID), then the result is not just a list of fields, but a list of full records?

Merc.

Is a list of keys, that can be used to access the whole record’s data

1 Like

How? As in, what would be a practical example?

Dereference expressions - AppSheet Help
1 Like