Format Rules Delay when referring to the Parent Table

My Parent Table has a [Color] column.
In the Child Table I use Format Rules according to the color in the Parent’s table like [Parent].[Color]=Green
I also added a Virtual Column to the Child Table to get the color value from the parent table with [Parent].[Color].

As you see in the Video, there is a delay: It will sync and after syncing, the Format Rule will be applied AND the Virtual Column with [Parent].[Color] will be calculated.

Can we reduce this delay in Format Rules?

FormatRules

I found a note from @Adam that maybe related to this issue.

2 Likes

Hi @Fabian
It looks to be AppSheet native behavior.
On your child table you are using virtual column where you repression kicked in. Virtual column calcuation which is dependency over the other rows or tables are always need to wait until sync complete.
That s the reason.

2 Likes

Virtual column values are only updated by the device when a non-virtual column value of the same row is updated as a result of user interaction with the app. All virtual columns are updated when a sync occurs, in which case the virtual column values are computed by the server.

@Steve has been explained this briefly on the other post, from where my knowledge is coming from.

All in all, the delay in applying the new format rule to column based on VC is kind of by design I would say.

1 Like

Hi @tsuji_koichi I added the VC just to check. I understand, that this VC needs a sync to calculate.
But the Format Rule should not need a sync.

In this Video I

  • Open the App in the Parent’s Deck View
  • I change the color
  • I then open the detail view for the first time
  • The Format Rule will be applied without the need of a sync
  • The VC needs a sync to be calculated (that’s okay)

This is working only if I don’t navigate in the detail view before. If so, AppSheet seems to remember the format rule and it will need a sync to update it.

FormatRules3

This is interesting. Not sure how it comes.
Behavior is changing based on from which view the action (for data change) is fired. Will see AppSheet masters will coach to us.

Based on the facts you shared, the detail view is going to be generated after hitting deck view firstly, then it will pulling data from clients side to apply the format rule, while we need to wait vc data is refreshed by sync. Entirely not sure how and why it comes.

2 Likes

Just a few weeks ago I noticed that format rules that rely on data in other rows experience this delayed update behavior. It appears to me that format rules are, in fact, reevaluated as are virtual columns: they see changes in columns of this row immediately, but don’t see changes in other rows until a sync happens. I don’t know if this is new behavior or long-standing. I don’t know if it’s considered a bug or not.

1 Like

I wrote to support@appsheet.com on 09.Feb.2021 about this. Back then I didn’t understand that it has to do with the referring to another table. AppSheet Support was not able to help me.

My goal was to use XY map view with Format Rules.
Now I found a workaround to get it done without the delay:

  • I added a Virtual Column to my Child Table with the expression: [XY] So it’s just a copy of my XY column. I named this column [XY_VC].
  • I made 2 map views: One with the map column [XY] and one with the map column [XY_VC].
  • I changed my action into a grouped action that: changes the color in the parent table AND navigates to the second map view.
  • In the format rules I marked both columns: [XY] and [XY_VC]

In the Video you see the Detail view with the first map view as the inline view.
It then navigates to the second map view.
Since the column [XY_VC] ist not shown in the detail view, the App does not “remember” how it is formatted. By navigating to the second map view, it get’s formatted for the first time.
For sure this workaround is working only once. But for my use case this is ok.
.

1 Like

I also tried other workarounds but with no luck:

  • Using another map view with the same map column [XY]
  • Using a slice with it’s own map view

Maybe someone has another idea?

1 Like

@Adam should be the only one gent to give us insight for this type of subject.

1 Like