Bug : show_if constraint not working on detail view?

dev2
New Member

Hi everyone,

I would like to hide the “Add” button on a detailed view, depending a condition. I found some articles where people succeeded into it, but cannot reproduce the expected behavior.

The purpose is to avoid adding new children to a parent, after a period of time (in this case, the day following the entry).
3X_b_5_b5652ef658a1ed66746164cc49f62d71e61f3bf5.png

I added a condition on the Behavior/Actions panel:

  • Table : LineItem_Pdt
  • Action : Add
  • Section : Behavior
  • Entry : Only if this condition is true
  • Formula for this entry : Mouvements_Pdt[Mvt].[TimeStamp]>today()

I proceeded to various tests, and this is what happens:

  • if condition is as I set it : “Add” is hidden on every entry
  • if condition is reversed : (< instead of >) : “Add” is available on every entry

But when I click on the “test” formula button, the results are as expected: “N” on old entries, “Y” on recent ones.

Do you have any clue on what happens ? Is that a bug, or a misunderstanding from me ?

Thanks for your help

Aurelien

0 14 327
14 REPLIES 14

This not under the behavior panel.

What you need to do is to

  1. create two slices. The first one has update mode of adds, and the second one is read-only

  2. You should have 2 ref tables on that table.

    A. Line items that refers to the slice that has add on it

    B. Line items that tefers to the read-only slice

  3. Lastly, adjust the show if of the two ref tables

Hi @June_Corpuz

Thank you for your answer, I will try this and let you know if that works.
Do you know why my first attemtp does not work, like if it’s a bug or just a mistake I made ?

Maybe someone from AppSheet team can explain it you @Steve

Please post a screenshot of the Add action for the LineItem_Pdt table, and of its complete If this condition is true expression.

dev2
New Member

Hi @Steve

Here you are

EDIT : Mvt refers to the Key of the table Mvt. I should have called it “keyMvt”

This expression is invalid:

Is Mvt a column in the LineItem_Pdt table? Is Timestamp?

dev2
New Member

yes:

  • Mvt is the column in the LineItem_Pdt table, wich refers to the key column of the Mouvements_Pdt

  • TimeStamp is a column from Mouvements_Pdt

Okay, so at the very least, the expression should instead be:

[Mvt].[TimeStamp]>today()

(i.e., remove the Mouvements_Pdt prefix)

Is the TimeStamp column of type Date, of type DateTime, or of type Time?

dev2
New Member

TimeStamp is of datetime type

Then the expression should be either:

[Mvt].[TimeStamp]>now()

or:

date([Mvt].[TimeStamp])>today()

depending on what comparison you’re trying to achieve.

dev2
New Member

Great, thank you ! I will try that immediately and let you know

dev2
New Member

Unfortunately…still does not want to work
I made a slight change to include today in the condition, as you see.


Do you want to access the app to look further, or do you want me to provide more informations or tests ?

Steve
Platinum 4
Platinum 4

I think someone’s going to have to look at your app. Please contact support@appsheet.com for further help with this.

dev2
New Member

Ok, I will do that.
Thank you yet for the time you spent on my case !

Top Labels in this Space