Context("View")

expressions
(David) #1

Hello. The context function (“View”) works correctly with the Form View but not with Detail or Table. I have a blank return.

(Reza Raoofi) #2

Can you explain more details and steps you took to see the unexpected result?

(David) #3

Yes of course. I would like my Detail page titles to be shown only if there are one or more records = “Non conform” but they all remain visible in the forms of course. it did not work. To find out where the problem comes from I created a virtual column CONTEXT (“View”). I posted it in each view. Only the Form view returns the correct answer. In the Details and Table views, the chaps remains empty. I understand better why my display condition does not work but it does not explain to me why some results of Context () return from the void.

(Reza Raoofi) #4

I believe using CONTEXT(“View”) in a Virtual Column may not be the best idea, as Virtual Columns are recalculated when there is change in data or you sync your app, whereas the current view could be changed as user navigates to different views; I also found this line in support document that could explain why you did not get results in some cases:
CONTEXT(“View”) returns the name of the current view or null if the expression is not run in the context of a view.
From this article:

(Reza Raoofi) #5

You could enter an expression like this in the Display name property of your Detail view:

=IF(IN(“Non conform”,Table[ConformColumn]),“Non Conform Title”,“Default Title”)

(Jonathon Sinclair) #6

If you are wanting to check the view type (Detail, Inline, Form), you should be using CONTEXT(“ViewType”).

(David) #7

Thank you for your answers that will help me to research. To be more precise, these are the “header page” of my Detail view that I want to display or not depending on whether there is at least one record “Not compliant”