Hide a view action when the view is not embedded in form

I have a folder that is used both as standalone and embedded in a form. I was trying to hide a view action in situation when the view is opened as standalone (not embedded) but I failed.I would not like to have two similar folders as it makes the code too complicated. The only solution I can think of is to use environment variables but I am seeking for something more sophisticated.

Any idea? Thanks in advance.

Subject: Hide a view action when the view is not embedded in form

Place a hidden field on the form called “ShowView” and give it a default/computed value of “1”.

Then give your action a hide-when formula of @If(ShowView=“1”; @False; @True)

Subject: RE: Hide a view action when the view is not embedded in form

Seems that the formula takes the value of ShowView field from the document currently selected in the embedded view and not from the document the view is embedded in. It does not work for me. Did you used it or is it just a proposal?Anyway thanks for your answer.