Appian Community and Appian Academy are being upgraded. From July 24–August 3, the Appian Community will be in read-only mode. During this time, the site will be read-only and user registration will be disabled. We apologize for any inconvenience this may cause, but a more secure, stable, and performant Community experience is coming soon!
The new Appian Community launches August 3, followed by Appian Academy on August 7. During the migration, Appian Community Edition, Appian Academy, Documentation, Certifications, Instructor-led Customer Training, Partner Sales Training & Accreditation, and Forum (for Appian Partners and Customers only) will remain available.
Hi Team,
I'm having an old grid layout. I'm having a field "Classification", Currently if the data is null its showing as emply(rounded below).
Now i want to put a condition, if any of the value is null/emply i should display as "None'" otherwise as it is value
existing data
Classification
Insurance
Banking
Null/Empty
Expected:
None
Using the following code
a!gridTextColumn( label: "Classification", field:local!gridDatasubset.columnConfigs[31].field, data: if( rule!APN_isEmpty(local!gridDatasubset.data.c61), "None", if( local!gridDatasubset.totalCount = 0, {}, local!gridDatasubset.data.c61 ) ) ),
Discussion posts and replies are publicly visible
If you're using the standard Appian Common Objects rules that I assume, then you should be using rule!APN_isBlank() instead of isEmpty. isEmpty checks whether an array is empty, but if you pass a single null element to it, the result will probably evaluate to a "false" value because that rule will see the input as an array containing a single null, and thus it is not an "empty array" as it was expecting.
Still no luck
a!gridTextColumn( label: "Classification", field:local!gridDatasubset.columnConfigs[31].field, data: if( rule!APN_isBlank(tostring(index(local!gridDatasubset,"data","c61",null))), "None", if( local!gridDatasubset.totalCount = 0, {}, local!gridDatasubset.data.c61 ) ) ),
Dang - the only other thought I have is maybe the field is getting returned with some non-null character like a space or a non-breaking space? -- actually scratch that, i realized the real issue and spoke to it below:
So... i'm not sure you're configuring your data: property quite correctly for the (now deprecated) a!gridTextColumn() rule. If you are able to use the 19.2+ gridField, you should consider switching. If you are unable to do this, i'm thinking your data: parameter should probably do something more like this:
data: a!forEach( local!gridDatasubset.data, if( rule!isBlank(fv!item.c61), "(None)", fv!item.c61 ) )
The problem with the null check you're attempting to do above is that you're passing in the entire array of "c61" fields to "isBlank", instead of the data for the current row. In my version we've fixed that issue. Also there's no reason to do your if() statement checking for a totalcount of zero, because a!forEach cleanly executes zero times when local!gridDatasubset.data is empty.
It worked,. Many thanks :)
If you have any possibility of migrating to the updated paging grid (19.2+), i recommend that as it's much easier to handle row-by-row data checks such as you're trying here. Also you can use rich text in grid cells, which is worth the cost of entry alone.
Sure, i will try to go for a new paging grid.