How can I get this value?

Screenshot 2022-05-11 165133.jpg

Is there an expression that can be written to get this number? I am trying to get an Action to fire if this number is "0", writing the expression into the "Only if this condition is true" option.

Any help is much appreciated!!!!

Daryl

0 13 278
13 REPLIES 13

Try this:

COUNT([Related Updates])

 This assume that the name shown in your view is the assigned name of the column.

Hello Willow,

The view shown is the system generated information, showing that the child table, Updates, has 0 related records to the ID number. Therefore, using your suggestion, I believe the proper expression is "COUNT([ID])=0" which gives me the error "COUNT function is used incorrectly." 

Thank you for the suggestion!

Daryl

Hi
I am not sure but give it a try ๐Ÿ˜‰

COUNT(
 REF_ROWS(
  "Related_DataSet", "Ref_col_ID"
 )
)

Thank you Mateo,

My parent table is EEs and my child is Updates. The Ref is the "ID" column. I tried this: COUNT(REF_ROWS("Updates","ID"))=0

No luck.

Thank you though!!

Daryl

 

Hello @Daryl_Zernick, did you try the expression that @WillowMobileSys suggested?

Yes. Here was my reply:

Hello Willow,

The view shown is the system generated information, showing that the child table, Updates, has 0 related records to the ID number. Therefore, using your suggestion, I believe the proper expression is "COUNT([ID])=0" which gives me the error "COUNT function is used incorrectly." 

Thank you for the suggestion!

Daryl

 

@WillowMobileSys expression is correct for obtaining the number of child records, you should really try it as it is @Daryl_Zernick 

Below is what I get when trying Willow's expression as written:

Screenshot 2022-05-12 111046.jpg

Trying it with what I believe is the correct syntax, "COUNT([ID])", generates the following:

Screenshot 2022-05-12 111436.jpg

It doesn't work because the name of the column doesn't match, can you share a screenshot of your table column names?

You need to use the name of this column in that expression:

Rafael_ANEICPY_0-1652368779051.png

 

What I find curious is that the system generated "View" is fired on this "NOT(ISBLANK([ID]))". Using the same logic for only showing the "Add" option when there are no child records, you would think "ISBLANK([ID])" would work, but it does not... when there are child records, "Add" still shows up.

I played with this some in my own app as I happened to be adding a child table in a view.  I also could NOT get the Add button to hide when testing  the count of rows.  I am not yet sure if this is a bug.

I tested by counting both the "related rows"  column - which by the way you can access by "Parent.[Related Rows Column]" as well as creating a SELECT expression.  I also tried using ISBLANK vs ISNOTBLANK.  In none of these cases could I get the Add button to hide.  I believe they should have worked but want to take a closer look.

Obviously, I could use FALSE or TRUE, and it would work just fine.

Thank you Willow! I am also trying a totally different solution that was provided here: https://www.googlecloudcommunity.com/gc/AppSheet-Q-A/Show-quot-Add-quot-if-ID-is-not-already-in-tabl...

This solution seems like it should work, however, I am again lost on the proper COUNT expression for the records in the child table. 

Thanks again for your time on this!!!

Top Labels in this Space