Format rules based on child table with images

Hi,

I have two tables: parent with text data and child with 3 images. I want to apply format rules on parent table to know (and show) how much images are added.

I’m using IsPartOf option.

Parent table columns: [ID] and other non-important

Child table columns: [ID] ; [ref parent row] ; [image 1] ; [image 2] ; [image 3]

Is it possible? Maybe add virtual column to parent table with filtered Count()?

Format rules cannot be used to display content, such as a count.

Format Rules: The Essentials - AppSheet Help

1 Like

Yes, you are correct. But I can create virtual column with count() and add format rule based on that value.

*Or other function. What would be the best way?

You could add a column in child table called say [ImageCount] with an expression something like

IF(ISNOTBLANK([Image 1]), 1, 0)+

IF(ISNOTBLANK([Image 2]) ,1, 0) +

IF(ISNOTBLANK([Image 3]), 1, 0)

You can then pull this column in the parent table with an expression

SUM([Related Children][Image Count])

and suitably use in format rules.

1 Like

The first part works.

Is the second part correct? I think it should be SUM(childtable[Image Count])? But it show me the sum of all records in the table. I want to show information per record - 0, 1, 2 or 3.

Please elaborate your requirement. How do you wish to implement format rules in the parent table? I mean if there are 4 child records, the format rule should be based on which of those 4 child records?

1 Like

It will be there always one child record. But in this record could be 1 image or 2 or 3.

I want to have in (parent record) information how many images are in the child record.

The goal is to check for missing images.

Then the expression

SUM([Related Children][Image Count])

Will return the image count.

1 Like

Or please try with

[Related Children][Image Count] or

NUMBER([Related Children][Image Count])

1 Like

And [Related Children] is which column? Ref from child table?

Yes, it is reverse reference column in the parent table. The system created that always starts with [Related…]

1 Like

Ohh, okay. Now I fully understand. It works. Thanks!

2 Likes

Great. Nice to know it works the way you wish.

1 Like