So I have an interface where in a read-only grid the user can select a specific "event" which then shows another read only grid with that particular events information. I would like a way to hid a column in the break down when the value is null but show when there is a number in the value.
For example, in the picture, hide "Energy", "Air Gas", etc
Thank you
Discussion posts and replies are publicly visible
Was there supposed to be a picture attachment with this? If so, I don't see anything -- just in case you want to re-try that.
Yes, there was. Thank you
So is this grid intended to only ever have one row? I guess I'm unclear why even use a grid at all, though i guess with that many columns it might offer you better "compactness"...
Yes, it will only ever have one row. The "compactness" is exactly why. I thought about just text boxes but just wouldn't look as clean.
Gotcha. For the show/hide columns, you can probably just have the "showWhen" of the individual a!gridColumn() calls check whether that property of the data row is blank? This might depend on where you're storing the data that's used in the row, but this should be possible I'd think.
It is being pulled from a SQL database into a RecordType.
I have tried this with no luck.
I believe you'll need to load the query results into a local variable first. Here when you're doing your "showWhen" check, I don't believe it's actually looking at the resulting data value (much less for a specific row, which in your case will always be row 1). After the data is in the local variable, you'd hardcode your "showWhen" to check that row, i.e.
showWhen: local!rowQueryResult[1].energy <> " "
Thanks Mike.
How do I load the query results into a local variable?
A normal query would work, I assume - can you share a screenshot / code snippet of the current configuration of the "data:" parameter of your grid? I can (hopefully) give more detailed advice upon seeing this.
I might also add that using rule!apn_isNotBlank() may be better in this case since Appian sometimes does type conversion behind the scenes.
showWhen: rule!apn_isNotBlank(local!rowQueryResult[1].energy)