Formula in Show Section_Header field triggered twice when form displayed through notification link

My app displays a random aphorism (quote) in a form section heading using a Show Type virtual column.  The idea is that when the form first appears there should be a new(ish) aphorism as the section header.

Here is the field definition:
LJP_0-1656345500089.png

The formula in full simply indexes to a random row in the Aphorism column:
index(
   Aphorisms[Aphorism],
   randbetween(1, count(Aphorisms[Aphorism]))
)

Everything works fine on the web app.

However, when the form is accessed just after the app is loaded (not just synced) on a smartphone and if accessed via deeplink to the form in an app notification, one quote is initially displayed and a few seconds later a second quote replaces (overwrites) it.  This is consistent behaviour.

Less consistently, I have seen the effect even after the app is loaded and the form accessed multiple times.

It looks like the formula is being triggered twice.  Any thoughts would be most welcome?

[Updated with further information to explain that it is related to app start on the smartphone not just the deeplink notification.

Updated with observation of effect after app statup]

Solved Solved
0 4 115
1 ACCEPTED SOLUTION

Easily reproduced and, in all likelihood, a bug.

Some investigation established that the problem is with Show type columns, real or virtual.  It does not happen with columns of type Long Text or Ref, using same formula as Initial Value, either virtual or real.

The workaround is to use non-Show type columns real or virtual.

However, getting the same format effect as a heading or sub-heading using format rules is tricky because format rules do not apply as easily to Text type columns.  To get around this you can use a virtual or real Text column as the base value an Initial Value formula and then create an additional Show type column (virtual or real), setting the Content formula to reference the underlying Text column.

View solution in original post

4 REPLIES 4

I've never understood why people use a virtual column for these show types -  this requires you to rearrange your columns inside the form.

Why not just add the show column, as a physical column to your table, where you need it - that way the show type is in line with the rest of the columns by their natural order? 

Don't mind me, just a side comment from something I've noticed over the years.

Don't mind at all.  I read somewhere that Show columns were virtual so... news to me 🙂  Thanks

Thinking about this, I checked and I could not find the reference.  Must've been dreaming.  Not that it matters but I thought a virtual column made sense because the field is a transient UI element that is independent of the underlying table.

Easily reproduced and, in all likelihood, a bug.

Some investigation established that the problem is with Show type columns, real or virtual.  It does not happen with columns of type Long Text or Ref, using same formula as Initial Value, either virtual or real.

The workaround is to use non-Show type columns real or virtual.

However, getting the same format effect as a heading or sub-heading using format rules is tricky because format rules do not apply as easily to Text type columns.  To get around this you can use a virtual or real Text column as the base value an Initial Value formula and then create an additional Show type column (virtual or real), setting the Content formula to reference the underlying Text column.

Top Labels in this Space