Simplify Format Rules expressions to improve performance

It has been suggested to me (by the performance analyzer) that there could be a potential improvement in sync times, because of Format Rules expressions on a table.

Does anyone have any suggestions how I could improve these expressions?
Security filters are already in place.

Expression 1.
AND(
[AssignedTo]=UserSettings(UserID),
ISNOTBLANK([AssignedDate]),
HOUR(TODAY() - MAX( LIST([LastUpdated], [AssignedDate]) ) ) / 24 >
LOOKUP(โ€œAddress Fieldsโ€, โ€œAppSettingsโ€, โ€œSettingNameโ€, โ€œNumeric_โ€)
)

Expression 2.
AND( [AssignedTo] = UserSettings(UserID),
HOUR(TODAY() - MAX(LIST( [LastUpdated], [AssignedDate] )) ) / 24 <=
LOOKUP(โ€œAddress Fieldsโ€, โ€œAppSettingsโ€, โ€œSettingNameโ€, โ€œNumeric_โ€)
)

Expression 3.
AND(
OR(ISBLANK([AssignedTo]),
AND(ISNOTBLANK([AssignedTo]), UserSettings(UserID)<>[AssignedTo])),
HOUR(TODAY() - MAX( LIST([LastUpdated], [AssignedDate]) ) ) / 24 >
LOOKUP(โ€œAddress Fieldsโ€, โ€œAppSettingsโ€, โ€œSettingNameโ€, โ€œNumeric_โ€)
)

Any tips gratefully accepted

1 5 339
5 REPLIES 5

LeventK
Participant V

@David_Joyce
Setup a VC in your table with this expression:

AND(
[AssignedTo]=UserSettings(UserID),
HOUR(TODAY() - MAX( LIST([LastUpdated], [AssignedDate]) ) ) / 24 > LOOKUP(โ€œAddress Fieldsโ€, โ€œAppSettingsโ€, โ€œSettingNameโ€, โ€œNumeric_โ€)
)

Then you can evalueate:
Expression 1:
AND(
ISNOTBLANK([AssignedDate]),
[VirtualColumnName]=TRUE
)

Expression2:
[VirtualColumnName]=TRUE

Hmm. Ok, thank you very much. That would simplify the expression certainly, but AppSheet tells us that virtual columns also have a performance cost. I will try it and see what effect it has, thanks again

@David_Joyce
Using complex expressions in Format rule conditions are always much more expensive than using them in Virtual columns

Hmm, Thats a nice little nugget of information, which I did not know. My thanks, once again, sir!

Youโ€™re welcome @David_Joyce, my pleasure. Glad to be helped of.

Top Labels in this Space