Hello,
My app has a parent table to store all customer basic details & an inline views for child table.
How can i hide the inline view (in detail view) when theres no data entry for that customer? I plan to show the inline view only when theres data in it.
Is there any way to hide the inline view in this situation
Solved! Go to Solution.
@drfuadj wrote:
CONTEXT("ViewType") <> "PATIENT_Detail"
PATIENT_Detail is not a view type. Likely that's the view's name, and the view type value you want in this part of the expression is simply "Detail".
@drfuadj wrote:
(CONTEXT("View") = "PATIENT_Form"),
(CONTEXT("View") = "PATIENT_Form 2")
These may be superfluous. If you use CONTEXT("ViewType") <> "Detail"
, then the expression will already be true for any form view.
ahh, ok understood, Thanks a lot for the clarification & guide. This is the expression i use and it works:
Use a COUNT() (or ISBLANK()) expression in that [Related...] column's show_if.
Can i use the expression isnotblank? Its kinda work. I put it inside the "Show?" column like this:
ISNOTBLANK([OPD Appt])
"OPD Appt" is the Related Data Column
Ive tried using isblank and not sure why its not working. I didnt understand the proper way to use the formula act thats why it doesnt work i guess.
Now i able to hide the inline view using the isnotblank expression but i noticed the inline view also disappear in a form view of the parent table.
Is there a way i can specify to hide the inline view when its empty ONLY in detail view of the parent table? and does not affect the form view
Thanks for the heads up. Now i know we can use the CONTEXT expression to achieve this, but im still figuring out how to use the context formula in my situation ๐
AND(
ISNOTBLANK([OPD Appt]),
CONTEXT("ViewType") <> "Form"
)
Thanks for the reply sir, i tried to use the expression but the inline view still didnt show up in the form view
My draft example should have used <> "Detail"
(or maybe = "Form"
). Sorry for the confusion.
Thanks alot for the jelp, by using youur ideas im using this expression to make it work:
OR(
ISNOTBLANK([Related DATAOPDs])
(CONTEXT("ViewType") <> "PATIENT_Detail"),
(CONTEXT("View") = "PATIENT_Form"),
(CONTEXT("View") = "PATIENT_Form 2")
)
Im tyring and error and the above expression works for my use case. However do hope you can enlighten if theres any other implications if i use the expression above.
@drfuadj wrote:
CONTEXT("ViewType") <> "PATIENT_Detail"
PATIENT_Detail is not a view type. Likely that's the view's name, and the view type value you want in this part of the expression is simply "Detail".
@drfuadj wrote:
(CONTEXT("View") = "PATIENT_Form"),
(CONTEXT("View") = "PATIENT_Form 2")
These may be superfluous. If you use CONTEXT("ViewType") <> "Detail"
, then the expression will already be true for any form view.
ahh, ok understood, Thanks a lot for the clarification & guide. This is the expression i use and it works:
By using the count() function
How actually i can put in the expression if i wanna use the count() function?
In ShowIf of the column OPD Appt add this expression
Count([OPD Appt])>0
Thanks alot for showing me how to use the formula in this situation. That helps a lot. Now im trying to hide the "OPD Appt" Inline view when its empty in Detail View but shows it up in the form view when people want to register for the details.
In the SHOWIF formula for your [Related....] field
OR(CONTEXT("ViewType") = "Form",ISNOTBLANK([_THIS]))
Thanks for the help. Ive tried using this expression and put it in the [Related..] field,
It able to hide the empty inline view in the detail view, but at the same time it also hides the inline view in the form view.
Im trying to achieve to get the "inline view"to show up in the form view eventho its empty, but at the same time hides the "inline view" in the detail view when its empty.
Is your Form based directly off the Table or based on a Slice of the Table? If a slice, are all the fields available to be placed onto the Form?
Can you screenshot your Form View definition showing the list of columns and the order you want them to appear?
It is based directly from the Table. When using the expression you gave, the inline view in Detail View shows correctly as what i wanted to achieve. But the problem is only in the form view.
In detail view:
When theres data: the inline view shows up
When theres NO data: the inline view disappears
But in form view:
It doesnt show up at all
Heres the images:
This is when i use the formula you provided:
OR(CONTEXT("ViewType") = "PATIENT_Form",ISNOTBLANK([_THIS]))
This is how i intended the inline view to show in the form when new registration comes in.
The 'New' option on a Form only appears if the related record is configured to be a 'Part Of' the parent record.
In your table that has your appointments find the Key field (I'm guessing this will be the master Patient ID) and check to see if the Is a part of? is ticked for the Ref field.
Ive checked in the appointment table (child table): OPDDATA
And yes, the "Is a part of" is ticked for the Ref field.
The intended plan:
In detail view: the inline will not be shown in the detail view of the parent table when theres no data in it & only when theres data it will be shown <--- i think this problem has been solved
In form view: the inline view readily shown with the parent table form
Are you using the built in Actions of Appsheet to open your form, or have you created your own action?
For opening a form to EDIT an entry that already exists you need to use a LINKTOROW command and not a LINKTOFORM command. This only applies if you have defined your own action...
I'm using the appsheet actions
Btw i've tried using this expression and it kind of working:
User | Count |
---|---|
26 | |
25 | |
24 | |
23 | |
20 |