ADD and UPDATE Form, how to hide columns in ADD and show in UPDATE?

Hello everyone,

So I have this maintenance reports table which I can read from my app.
I want users of the app to be able to fix the reports and update the table from the Detail view with the Form that was generated automatically by the system, this works fine. this is the icon I see in the details view which allows UPDATES: 3X_b_d_bdb17ebc236f889e53173531e986e7788139c213.png
I have set that up so that the โ€œUPDATE columnsโ€ to fill with the Form (i.e. Photo after) are not visible in the Detail View, only in the form.

I also want users to ADD new reports to the table. And here is where I have the problem.
In the Primary view of the table I have this icon which allows users to ADD a new row or report: 3X_1_c_1c8dc5ea036f39f93508eae2c45debe8963531b7.png
So far, so good. The problem is that when they do this, because the columns for the UPDATES (i.e. Photo after)are set to be required, they are also required here. And that kind of makes no sense since itยดs a new report, you shouldnยดt have an โ€œafterโ€ picture.
I tried hiding them (UPDATE columns) using the Edit_If option with a ISNOTBLANK() expression, associated to the first columns (i.e. Report date). This works ok when the ADD form is empty, but as soon as I type the date, the other fields appear again.

Any ideas on how to bypass this?

PS. Im sorry I tried to keep the post as short as possibleโ€ฆ But Im not sure about my english, so I had to explain a bit better.

Solved Solved
0 9 787
1 ACCEPTED SOLUTION

@Nicolas_Feldman
You can choose to show/hide a column with Show_if expression like this which means:
if the expression evals to TRUE you are editing an existing record and shows it
if the expression evals to FALSE you are adding a new record and hides it

IN(
    [KeyColumn],
    TableName[KeyColumn]
)

You can also use the same expression in Required_if property of a column

View solution in original post

9 REPLIES 9

@Nicolas_Feldman
You can choose to show/hide a column with Show_if expression like this which means:
if the expression evals to TRUE you are editing an existing record and shows it
if the expression evals to FALSE you are adding a new record and hides it

IN(
    [KeyColumn],
    TableName[KeyColumn]
)

You can also use the same expression in Required_if property of a column

Awesome, thanks Levent!

I havenยดt noticed, now that Iยดve applied that Show_if expression, in the Details View, I can see the name of the column and the empty field (i.e. Photo after) for reports that are not yet fixed.
I can live with this, but would be great if I could fix it.

3X_2_5_25dd778768b9db26ce2bd729d2aaffcf1d90aae0.png

Thanks again!

What do you want to achieve @Nicolas_Feldman, can you be more specific with that detail view?

Im sorry Levent I wasnt specific enough.
So we are talking about the same table and views as in the original post.
I have this table with reports that users are able to UPDATE records when they are fixed, or ADD new reports.
When user Adds a new report only the first columns show, (i.e. photo before and report date)
When user Updates a report all columns appear, so that the last columns (i.e. photo after and service date) also show and are editable.
It all works now with the expression you proposed before: IN( [KeyColumn], TableName[KeyColumn] )

What im trying to do now is to hide those fields that are empty from the โ€œreadโ€ section of the details view, NOT in the form.
For example, when reading an existing report that hasnยดt been updated (in the details view), I can see the empty fields there from the this is what im trying to hide. (you can see those fields in the attached screenshot.
3X_2_5_25dd778768b9db26ce2bd729d2aaffcf1d90aae0.png

Thanks again!

If the Show_If expression evaluates to TRUE, the column will be displayed even if the columnโ€™s value is blank. To avoid this, you can enhance your expression to handle this case by also checking with ISBLANK() or ISNOTBLANK():

AND(show?-expression, ISNOTBLANK([_THIS]))

Alternatively, have your Show_If expression evaluate to a blank value to allow the default display behavior:

IFS(hide?-expression, FALSE)

Thank you Steve, Iยดve tried this but it applies to both Detail and Form View.
This means if the expression is TRUE, it is not shown neither in the detail view nor in the form view, so the user cannot fill the field.

Thanks again for your assistance!

@Nicolas_Feldman
You can add:

CONTEXT("ViewType") = "form" // or "detail", "table" etc.

OR

CONTEXT("View")  = "YourViewName"

expression to your TRUE statement

Top Labels in this Space