How to change the name of a view, when opened by certain action or from a certain view?

Hy,

I am having some trouble getting the right Form to be opened by the right Action Button. Theyโ€™re tricky to explain but I guess an easy solution is if there is a formula to put in the Display field of the Form View, to tell it that, if it is opened by a โ€œCertain buttonโ€, it would have โ€œA nameโ€ and if opened by โ€œAnother buttonโ€ it would have โ€œAnother nameโ€.

Is there such a formula?

Or it could also be - if previous view was โ€œThis viewโ€ than the for would have โ€œThis nameโ€ and if opened from โ€œanother viewโ€, it would have โ€œAnother nameโ€.

Thank you,
Sorin

0 11 2,786
  • UX
11 REPLIES 11

Hey Sorin.

In order to make this functionality what Iโ€™ve done is include a column in the table to hold a variable that you can then use for programming and such.

I call it Form_Type, make it a text and hide it; Iโ€™ll pick some keywords and add them into the LINKTOFORM() actions, then use show ifโ€™s etc. to configure things.

On the Save action of the form, Iโ€™ve got another action to clear the Form_Type column, this way itโ€™s always blank; you could leave this part out, if you always open the form via a custom action, but if you edit the action by the system generated action, the Form_Type will be whatever it was last time - this is why Iโ€™ve taken to making a clear action to fire off at the save.

Hope it help!!!

@MultiTech_Visions Thank you, I really got some ideas out of it but not related to my issue really, your explanation is a bit over my head. But I think Iโ€™m good for now.

Just to explain if others read into this post:

The issue is that I make a Projects Table and add it to Appsheet.
Then I get an automated Project_Form View and in Actions, I get an Add and an Edit automated actions (and others but these two make the point here).

The thing is that both Actions access the same form. And I use the Display View Title up on the menu bar option, so Users (me included :)) ) know where they are. So I guess you guessed it by now, the perfectionist in me wants to have the Title Display โ€œAdd new Projectโ€ when you get to the form by hitting the Add Action, and โ€œEdit Projectโ€ when you get to the form by hitting the Edit Actionโ€ฆbut since both actions go to the same view, you get one name.

Now I think I might also have some bugs on the app (or maybe I didnโ€™t work cleanly enough) because I made new views and new action buttons with linktoview links between them, but Iโ€™m having trouble making them work (some do some donโ€™t โ€ฆ some work but have the button appear on a different page for some reason โ€ฆ Iโ€™m not figuring out a rule there to be able to explain it โ€ฆ even as a bug) so for now, my solution is:

I named the form Add/Edit Project :)))
and thatโ€™s good enough for now. Iโ€™ll address it again when Iโ€™ll have more Appsheet experience.

Thanks Matt

You might be able to figure out a hack using a ChangeCounter column

Try:

IF(
  ISBLANK(
    FILTER(
      "Projects",
      ([Project Name] = [_THISROW].[Project Name])
    )
  ),
  "Add",
  "Edit"
)

replacing Project Name with the correct name of the Projects tableโ€™s key column if I remembered it incorrectly.

Here, weโ€™re exploiting the fact that FILTER() (also LOOKUP(), MAXROW(), MINROW(), and SELECT()) scans the actual table, ignoring the copy of the row in the form. A row in the form for adding doesnโ€™t yet exist in the table, so if we look at the table, we wonโ€™t find it. If we donโ€™t find the row of the form in the table, a new row is being added. If the row of the form does exist in the table, an existing row is being edited.

This same approach can be used to compare a column value in a form with the value in the saved copy of the row.

Hack hack hack, all day long. Hack hack hack while I sing thing song.

Hy @Steve,

Where would this formula go?

The Display name expression. We were talking about display names, right?

The display Name of the Form. So here right?

Yes.

Hi @Steve When I try your expression I get this Error Message:
Error in expression '[_THISUSER].[Key]' : Unable to find column 'Key'
Sot it changes [_THISROW] to [_THISUSER].

I am wondering if [_THISROW] is available in the Display Name expression, because it says:
This formula is not evaluated in the context of a row, so column values are not available.

Maybe this is related to this post?

Argh! Yes, _THISROW is not available in display names! I recall now that when I use this formula, itโ€™s as part of a Show column that I use as a view title, not as a page display name. Sorry for the confusion and false hope!

Top Labels in this Space