Virtual value to be quickly refreshed before the page is loaded

teambelair
Participant V

Hi All,

I have a virtual field that displays the current user score (see .gif. Field in blue).

3X_f_a_fadad126b2f585e0c348c42dfed7da32e6d27a27.gif
Note: I cut out from this gif the waiting time for the score to be updated.

Every time the user taps on the Complete button, a record is added in a another table called Class_Card_Logs that stores all exercise cards that have been completed for that session. The expression of the virtual field is using a SUM(SELECT(Class_Card_Logs[Points], filter)). Then the user is redirected right away to another exercise card. The problem is that the virtual field doesnโ€™t have time to load the updated score before the page is loaded. So the user has to wait 5-10s to see the accurate score.

I canโ€™t think of any simple solution that wouldnโ€™t involve changing the architecture (ex: have a table to keep the score in a non-virtual field and showing it via a dashboard while showing the exercise detail view in another window of the dashboard). I could also do a full sync after each exercise completion but that wouldnโ€™t be user friendly.

Has anyone found some alternative to this problem?

Thank you!

Solved Solved
0 12 268
  • UX
1 ACCEPTED SOLUTION

Itโ€™s using the virtual column weโ€™ve already established wonโ€™t be updated, so of course itโ€™s going to have the same problem. Try computing the counts in the Content expression.

View solution in original post

12 REPLIES 12

hru
Participant V

What I did was using a SUM(reverse reverence) and another VC for the text with CONCATENATE. Iโ€™ve test that using a LOOKUP and it seems that both of them displayed the value before sync is completed.

Awesome!

Can you expand on the SUM(reverse reference)?

Are you suggesting to have 3 separate fields on the same table?

  • SUM(): get the value from the other table
  • CONCATENATE (): build the text to display
  • LOOKUP(): which field do you lookup?

On my case is something like:

SUM([Related OrderDetailTable][Price])

Two VCs: The SUM to calculate the total and the CONCATENATE for the text to be shown on the card view.

If you donโ€™t have a [RelatedITemColumn], you may try with LOOKUP, to look to the SUM column.

Steve
Participant V

No matter how you structure your virtual columns, they will not update until either a sync occurs or the row containing the virtual column value is updated in some (non-virtual) way. Trying to force a sync isโ€“as youโ€™ve notedโ€“not user-friendly. Instead, consider making a trivial benign change to the row youโ€™re sending the user to in order to prompt the virtual column to update. You may want to add a normal (non-virtual) column for this very purpose. You could also instead consider making the existing virtual column a column of type Show and use its Content property to provide real-time values. The downside is that Show columns donโ€™t format well in detail views.

@Heru In my case I donโ€™t have a direct relationship to do a reverse reference but thanks Iโ€™ll keep this in mind. I tried to use a LOOKUP on a table where the score is updated but the same scenario occurs.

@Steve

You may want to add a normal (non-virtual) column for this very purpose

Yeah, I canโ€™t have this field on the current table. I do update the score on another table โ€˜Class_Logsโ€™. Querying it via the virtual fields gives the same result.

You could also instead consider making the existing virtual column a column of type Show

I converted the virtual field into a Show column but it also gives the same result.

The only option I see right now is to have the Class Log table at the top of a dashboard so the score can be displayed and the current view at the bottom of this dashboard. Itโ€™s a major change on my hand and the format wouldnโ€™t be as nice as right now.

the row containing the virtual column value is updated in some (non-virtual) way

Is there another option to do that?

Thank you!

Thatโ€™s odd. Did you use a Content expression as I suggested?

Nothing other than the option Iโ€™ve already given.

Did you use a Content expression as I suggested?

I added this following code into the Content field.

CONCATENATE(
    	[Fast Class Completed Cards Count]
    ,
    	" completed"
    ,
    	" ("
    ,
    	[Fast Class Points Collected]
    ,
    	IF([Fast Class Points Collected]>1, " points)", " point)")
    )

Itโ€™s using the virtual column weโ€™ve already established wonโ€™t be updated, so of course itโ€™s going to have the same problem. Try computing the counts in the Content expression.

Thanks Steve. That works great!
Why canโ€™t we have the same behavior in non Show type field? I canโ€™t referred to the Show field content from another virtual field right?

I donโ€™t know.

Correct.

I think the LOOKUP works in this case because it is the same record.

Top Labels in this Space