Hi All,
I build a counter that shows the number of card and time left (see on the top left of the gif)
It works great but when I wait a bit, the counter gets automatically reinitialized for no reason. I canโt figure why. Since this class has very few exercises, the class duration is only 1 minute. For bigger class, the same issue occurs for the time left.
Here are the field definitions:
The counter field is called โFormatted Summary Class In Progressโ.
[Class Cards]:
[Cards Completed]:
[Formatted_Duration_Left]
Thank you!
Any help on that?
I donโt know if it is a normal approach, however what I did for card view is having a separate VC just for doing calculation and another VC for doing the text with app formula CONCATENATE("Blabla", [CalcVC])
.
got it. Will try that and get back to you.
One more thing you may wish to consider is that in the expression
COUNT([Class Cards])-[Cards Completed]
to show number of cards left, the part COUNT([Class Cards]) seems to remain intact because the โcards leftโ number resets to the orginal highest number that comes from [Class Cards] column.
So the column [Cards Completed] seems to reset back to zero.
Thus if you are testing the expression in the emulator, I believe the CONTEXT(โDeviceโ) used in the expression of the column [Cards Completed] could be creating an issue.
I suggest you test the expression on a mobile device. This is so because in the emulator, following behavior of the CONTEXT('Device") expression is mentioned. So in emulator testing the device UUID could restting the value of [Cards Completed] to zero.
Quote from the article: In the emulator of the app editor, the value is randomly generated each time the editor is loaded or changes are saved.
Thanks @Suvrutt_Gurjar but I have seen the bug happening on the mobile app as well
Oh, ok, thank you for the update @teambelair.
In general, since it is the second part of expression that seems to be failing, it may be good idea to to test by eliminating each of the subexpression parts, starting with CONTEXT(โDeviceโ)
Can the expression be tested without CONTEXT(โDeviceโ)?
You are right. I updated the expression of [Cards Completed] by removing the CONTEXT(โDeviceโ) and it works fine. The counter doesnโt get reset.
COUNT(
SELECT(
Class_Card_Logs[Key]
,
[Class_Log]="Hardcoded_key"
)
)
Whatโs the best way to share this bug with appsheet?
I canโt think of any workaround since I have to use CONTEXT(โdeviceโ) to identify the current user session.
Nice to know that the issue is now known.
Well, I believe the CONTEXT() functions in general , as the name suggests, work for that particular CONTEXT(), either a view or view type or device. So those need to be used with that understanding.
So it may not be a bug but possibly a particular condition during which the CONTEXT() function is not applicable and thus the expression fails.
You may write to support@appsheet.com for guidance. or you may start a new post thread by stating the exact problem ( now identified with CONTEXT(โDeviceโ) ) so that some community colleague could share insights.
Thanks, I sent an email to the appsheet support.
During my testing, it seems that the CONTEXT(โDeviceโ) is โstableโ when utilize it with a Security filter. The Chrome utilized is with a dedicated profile on a session, even when closing all tabs, shutdown and re-open chrome to re-open the test app, it still showing the intended record per the CONTEXT(โDeviceโ) that is specified.
I am on the PUBLISHER_PRO plan so I donโt have access to the Security filter. Iโm adding my filter in the Row filter condition of the slices.
@teambelair, Could you update if you are running the app in browser in mobile device or have you installed it in the mobile where you are testing it?
Edit: You may wish to check above because โDeviceโ as a host seems to be working when the app is installed in the mobile.
Below are excerpts from the article -
Host : Gives Browser
if the app is running in a browser or the app editorโs emulator, Device
if a native app, or Server
if used from an AppSheet server (e.g., in a workflow or report).
So you may wish to include iexpression something like below and test with the app insalled on the mobile device.
AND( CONTEXT(โHostโ)=โDeviceโ , CONTEXT(โDeviceโ)=[Device])
Note : The above suggestion is untested.
The app is mostly run on the whitelabel mobile app. I say mostly because power users do use it on web browser as well but the priority is on the app.
Also CONTEXT(โdeviceโ) is working fine. Itโs just not working in this particular case where a virtual column calls a SELECT with CONTEXT(โdeviceโ) as a filter.
If:
Have your tried to split with a new VC:
SELECT(Class_Logs[Key],
AND(
NOT([Fast Class]),
[Device]=CONTEXT(โDeviceโ),
[Status]=โIn Progressโ)
)
And the COUNT:
COUNT(FILTER("Class_Card_Logs",[Class_Log]=INDEX([NewVC]), 1))
Ok, thank you for the updates @teambelair.
I have no further discussion points to share on this topic. I will definitely share if I am able to create similar test conditions and I find any useful observations to share.
Thanks @Heru. That is a useful input. I believe it shall be useful to the community while testing CONTEXT(โDeviceโ).
I believe your tip is worth sharing in Tips and Tricks section. You may wish to do that.
User | Count |
---|---|
44 | |
29 | |
22 | |
20 | |
14 |