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
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!
User | Count |
---|---|
39 | |
35 | |
29 | |
23 | |
18 |