Hi everyone,
I currently have a grid that only displays one out of six columns. I recently added the last five out of six column fields, but for some reason, none of the new fields are displaying. Does anyone have an idea of what I'm doing wrong?
Unfortunately, I was passed down this code from someone else and am a newbie to Appian, so the code is pretty large. If anyone can direct me to what the specific piece of code entails that I should show you all to help debug, that'd be great too.
Discussion posts and replies are publicly visible
Hi, to answer your first question. The first column is displaying properly. I am using gridField. Here is a piece of my grid field code: a!gridField( label: cons!TEXT_SELECT_A_STORE_LABEL, totalCount: ri!storeData.totalCount, columns: { a!gridTextColumn( label: cons!TEXT_NAME_LABEL, field: "Name", data: index( ri!storeData.data, "Name", {} ) ), a!gridTextColumn( label: cons!TEXT_STORE_ID_LABEL, field: "storeID", data: index( ri!storeData.data, "storeID", {} ) ), the Name label and data displays. The ID does not.
As soon as I typed the "*We have not DATA *" and attempted to test, I received this error: Could not display interface. Please check definition and inputs. Interface Definition: Expression evaluation error in rule 'grid_user_selectstores' at function a!gridField: A grid component [label=“Please select a store. ”] has an invalid value for “totalCount”. “totalCount” must not be null or less than the number of items in any of the “data” arrays, but “totalCount” was 0 and the largest column data array had 1 items.
The only reason I can think of why storeID might not be displaying is that your data set (ri!storeData.data) doesn't contain a property with the exact name "storeID". You probably need to check whether it's something different.
By way of testing, you can display the exact value of the datasubset you're working with in a test paragraph field that you can then remove later.
a!paragraphField( label: "DEBUG", value: ri!storeData, readOnly: true() )
We would need more context as to your overall form in order to know why you're getting that error (though i'd guess it's just syntax).
As a side note, I strongly encourage you to use the "Insert Code" tool in the Insert menu, to avoid making your posts impossible to read when pasting large chunks of code, and to retain formatting (which makes code 10x easier to read).
Update: Part of the reason the information was not displaying was because the CDT was using the incorrect fields. The CDT now uses the correct fields and all of the columns in the grid display information! However, now all of the information is the exact same as the first column. This is the new code: a!forEach( items: local!filterData, expression: 'type!{urn:com:appian:types:store}store_Entity'( name: local!filterData[fv!index],storeID: local!filterData[fv!index], storeNumber: local!filterData[fv!index], storeManager: local!filterData[fv!index], storeCity: local!filterData[fv!index], storeState: local!filterData[fv!index] ) ) What would be the reasoning for the duplication of information?