Hi.
I am having issues with creating UX View Show if Expressions (view linked to table โxxxxโ), for which, the Show if Expression must reference a different table/worksheet within a different workbook. The Show if Expression tried, refers to a Virtual Column called โCurrent Statusโ that is set as a โRefโ type, pointing to a worksheet column called "Voting Statusโ that is set as an โEmunโ type containing 5 optional values. A โTimestampโ column is set as the key and โVoting Statusโ column is set as the label.
I plan to use 2 APPS (one for โadminโ and one for โpublicโ) that utilize different workbooks and uses GoogleSheets for both APPโs. For this issue, both APPโs are linked to the same table in the same โadminโ workbook also called โVoting Statusโ and set up the same way as described above. In the โVoting Statusโ column of the โadminโ APP, a Valid if Expression exists that has 5 optional values set within curly brackets and displays as buttons in the โadminโ APP. The โadminโ APP sets the โVoting Statusโ column and the read only โCurrent Statusโ virtual column displays the current status equal to the โadminโsโ last selected voting status option that was saved to the worksheet. Within the โCurrent Statusโ virtual column, the following Expression (see below) is used to sort and filter the โVoting Statusโ column by the โTimestampโ column to filter and auto display the read only result in the โCurrent Statusโ column in the APP. This works perfectly so that the โadminโ APP always shows the current status that was last selected by the โadminโ for an easy read only reference, as the โCurrent Statusโ column updates immediately as a local device computed result within the โadminโ APP.
Next, since the โpublicโ APP references the same table/worksheet (perhaps using a Slice may have also worked?), the columns are setup the exact same way as in the โadminโ APP, except there was no need to include the same Valid if values in curly brackets because the โpublicโ APP users cannot set the status as this is only set by the โadminโ. By syncing the APP, the โCurrent Statusโ virtual column result in the โpublicโ APP always displays the same result as in the โadminโ APPโs โCurrent Statusโ virtual column, for which, is the goal.
Now, in trying to create a Show if Expression, I can get a lot of valid true/false expressions, but, none are working as intended to only show, or not, the โpublicโ APP UX view/s based on the โCurrent Statusโ. I canโt seem to get the Show if Expression to match the โCurrent Statusโ as the [Voting Status] is set, and reset, to a new status in the โadminโ APP. When using a simple expression such as โVoting Statusโ[Current Status], the result is the first posted [Timestamp] value in the list. When trying to use a more complex expression, I can get either the most recent posted [Timestamp] value result, or, a [Voting Status] result that is not relative to the most current [Timestamp] value result.
FYI: here is the formula used successfully in the โCurrent Statusโ virtual columns for both APPs to display the current status:
ANY(
TOP(
ORDERBY(
FILTER(โVoting Statusโ,[Voting Status]=[Voting Status]
),
[Timestamp], TRUE
),
1
)
)
Here is a sample expression that is valid in the UX View Show if Expression, but, the result provided is not what is required. This expression returns the most recent [Timestamp] value:
ISNOTBLANK(TOP(ORDERBY(FILTER(โVoting Statusโ,[Voting Status]=โVoting in Progressโ),[Timestamp],TRUE),1))
I can change the [Voting Status] to [Current Status] in the expression and get the same result. I can also alter the expression and get an unsorted list of [Voting Status] values from oldest to newest (most recent), for which, is not what is required, unless it was reverse sorted, or, relative to the most recent [Timestamp] value.
Your assistance is greatly appreciated. Thank you.
Solved! Go to Solution.
Aleksi found a solution for me. Thanks for your assistance.
Please concisely restate your question. Thereโs waaaay too much detail in there.
I apologize for the details. I thought it would help understand the problem.
Bottom line is, I need to create a Show if Expression for views in a โpublicโ APP, for which, the trigger is a row record from a different table and workbook than the View data is sourced from. An โadminโ APP is to control 3 different views visibility in the โpublicโ APP. An โadminโ APP creates the table row record based on a status of the event as selected from the โadminโ APP. The controlling table has a Timestamp and a Voting Status column, as well as, a Current Status virtual column. Essentially, as the event progresses through different stages, the โadminโ creates a table record indicating the current status, for which, the corresponding 'public APP UX View will become active while some view/s will not. This is to keep everything simple for the public user and only show them a view based on what is currently going on at the event.
Does this description help?
Okay, lemme see if I understand: in the public app, you want views to be shown or hidden according to the value of a column in a row of a table that is not displayed by the view itself. Thatโs not a problem. Youโll probably want to use the LOOKUP() function:
Consider that and let me know if you can use it. If not, there are other options.
Hi Steve:
Yes. The view/s to be shown or hidden are not determined by the data in the view itself. I want to reference the read only current status (single column value) in another view that is always visible.
I have tried your advice, however, the issue remains unresolved. I am most likely not writing the Expression correctly. I have one view in the โpublicโ APP that is read only and indicates the current status and is always displayed. This viewโs current status displayed text value is from a virtual column with a sort and filter expression (as shown previously) of a table in the โadminโ side, that records, by row, each status change entered by the โadminโ. In order to show or hide a view, I need to base this off of what the most recent current status is.
When I write a more complex Expression, it seems to get the most recent [Timestamp] value, but, not the most recent current status text value. When I try to check if the current status text value matches, I get the error that says canโt compared text value, or, Listโฆ This leads me to believe that it may be because the Expression that is valid is trying to compare the defined text string value against the [Timestamp] value.
If it matters, in the table, the [Timestamp] column is the key and the [Voting Status] column is the label. The [Current Status] virtual column is a Ref type and the [Voting Status] is Emun type.
I am totally stuck in getting the Show if to work. I sincerely appreciate your patience, understanding and willingness to help. Again, sorry for the lengthy reply, but, Iโm doing my best to describe the issue.
Please post a screenshot of this viewโs configuration.
Source Table
โadminโ APP Table/Column configuration (โpublicโ APP Table/Column set up the same)
โpublicโ APP View configuration
Iโm having a lot of difficulty understanding what the problem is an how your app is set up. I think you might have more luck engaging support@appsheet.com and allowing them to look at your app directly.
Ok. Will do. Thank you.
Aleksi found a solution for me. Thanks for your assistance.
For other readers that might be interestedโฆ the correct formula was
โVoting in Progressโ=
LOOKUP(
MAXROW(โVoting Statusโ,โTimestampโ),
โVoting Statusโ,โTimestampโ,โVoting Statusโ)
User | Count |
---|---|
18 | |
10 | |
8 | |
6 | |
5 |