UX View>Showif Expression Problem

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 Solved
0 10 1,680
  • UX
1 ACCEPTED SOLUTION

Aleksi found a solution for me. Thanks for your assistance.

View solution in original post

10 REPLIES 10

Steve
Platinum 4
Platinum 4

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.

  1. Source Table
    2X_7_70f890be44137385e95d71024e094b33631dbe07.png

  2. โ€˜adminโ€™ APP Table/Column configuration (โ€˜publicโ€™ APP Table/Column set up the same)
    2X_e_e8a28c383dcae71f2620c3a04292e803a8b74004.png

  3. โ€˜publicโ€™ APP View configuration
    2X_8_805d40eba83db1942901b3c18be376a90f678c96.png

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โ€)

Top Labels in this Space