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.
I am not sure how is your code, but here are two examples with your same structure, I hope this helps.
Please note this: From the code you shared before, you are doing some validations in the considering the filteredData was an array
{"text 1","text 2" , .. "text n"}.
Take care with this kind of things. I specifically refer to this, (that you posted before)
local!filterData: if( rule!AF_RULE_General_isBlank( local!search ), {}, index( local!data, where( like( lower(local!data), "*" & lower(local!search) & "*" ) ) ) ),
Example 1- With the dictionary
load( local!entities: { {Name:"Store One" ,storeid:"s1" , storeSymbol:"BON" ,storeCity:"Des Moines" ,storeState:"IA"} , {Name:"Store Two" ,storeid: "s2" , storeSymbol:"BTW" ,storeCity:"Boise" ,storeState:"ID"} , {Name:"Store Three" ,storeid: "s3" , storeSymbol:"BTH" ,storeCity:"Charlotte" ,storeState:"NC"} , {Name:"Store Four" ,storeid: "s4" , storeSymbol:"BFR" ,storeCity:"New York" ,storeState:"NY"} , {Name:"Store Five" ,storeid: "s5" , storeSymbol:"BFV" ,storeCity:"Houston" ,storeState:"TX"} , {Name:"Store Six" ,storeid: "s6" , storeSymbol:"BSX" ,storeCity:"Seattle" ,storeState:"WA"} , {Name:"Store Seven" ,storeid: "s7" , storeSymbol:"BSVN",storeCity:"Jersey City",storeState:"NJ"} , {Name:"Store Eight" ,storeid: "s8" , storeSymbol:"BET" ,storeCity:"El Paso" ,storeState:"TX"} , {Name:"Store Nine" ,storeid: "s9" , storeSymbol:"BNI" ,storeCity:"Jersey City",storeState:"NJ"} , {Name:"Store Ten" ,storeid: "s10" , storeSymbol:"BTN" ,storeCity:"Fort Worth" ,storeState:"TX"} }, local!pagingInfo:a!pagingInfo( startIndex:1, batchSize:-1 ), local!dataSubset:a!dataSubset( data:local!entities, totalCount: length( local!entities ), identifiers:local!entities.storeid, startIndex:1, batchSize:-1 ), a!gridField( label: "gridField", totalCount: local!dataSubset.totalCount, value:local!pagingInfo, saveInto:local!pagingInfo, columns: { a!gridTextColumn( label: "Name", field: "Name", data: index(local!dataSubset.data,"Name",{}) ),a!gridTextColumn( label: "storeid", field: "storeid", data: index(local!dataSubset.data, "storeid",{}) ),a!gridTextColumn( label: "storeSymbol", field: "storeSymbol", data: index(local!dataSubset.data, "storeSymbol",{}) ),a!gridTextColumn( label: "storeCity", field: "storeCity", data: index(local!dataSubset.data,"storeCity",{}) ),a!gridTextColumn( label: "storeState", field: "storeState", data: index(local!dataSubset.data,"storeState",{}) ) } ) )
Example 2 - with the CDT
load( local!entities: { {Name:"Store One" ,storeid:"s1" , storeSymbol:"BON" ,storeCity:"Des Moines" ,storeState:"IA"} , {Name:"Store Two" ,storeid: "s2" , storeSymbol:"BTW" ,storeCity:"Boise" ,storeState:"ID"} , {Name:"Store Three" ,storeid: "s3" , storeSymbol:"BTH" ,storeCity:"Charlotte" ,storeState:"NC"} , {Name:"Store Four" ,storeid: "s4" , storeSymbol:"BFR" ,storeCity:"New York" ,storeState:"NY"} , {Name:"Store Five" ,storeid: "s5" , storeSymbol:"BFV" ,storeCity:"Houston" ,storeState:"TX"} , {Name:"Store Six" ,storeid: "s6" , storeSymbol:"BSX" ,storeCity:"Seattle" } , {Name:"Store Seven" ,storeid: "s7" , storeSymbol:"BSVN",storeCity:"Jersey City",storeState:"NJ"} , {Name:"Store Eight" ,storeid: "s8" , storeSymbol:"BET" ,storeCity:"El Paso" } , {Name:"Store Nine" ,storeid: "s9" , storeSymbol:"BNI" ,storeCity:"Jersey City",storeState:"NJ"} , {Name:"Store Ten" ,storeid: "s10" , storeSymbol:"BTN" ,storeCity:"Fort Worth" } }, local!pagingInfo:a!pagingInfo( startIndex:1, batchSize:-1 ), local!store_entities: a!forEach( items: local!entities, expression: type!stores_Entity( name: index(fv!item,"Name","-"), storeID: index(fv!item,"storeid","-"), storeNumber: index(fv!item,"storeNumber","-"), storeManager: index(fv!item,"storeManager","-"), storeCity: index(fv!item,"storeCity","-"), storeState: index(fv!item,"storeState","-") ) ), local!dataSubset:a!dataSubset( data:local!store_entities, totalCount: length( local!store_entities ), identifiers:local!store_entities.storeid, startIndex:1, batchSize:-1 ), { /*a!paragraphField(value:local!store_entities),*/ a!gridField( label: "gridField", totalCount: local!dataSubset.totalCount, value:local!pagingInfo, saveInto:local!pagingInfo, columns: { a!gridTextColumn( label: "name", field: "name", data: index( local!dataSubset.data, "name", {} ) ),a!gridTextColumn( label: "storeID", field: "storeID", data: index( local!dataSubset.data, "storeID", {} ) ),a!gridTextColumn( label: "storeSymbol", field: "storeSymbol", data: index( local!dataSubset.data, "storeSymbol", {} ) ),a!gridTextColumn( label: "storeCity", field: "storeCity", data: index( local!dataSubset.data, "storeCity", {} ) ),a!gridTextColumn( label: "storeState", field: "storeState", data: index( local!dataSubset.data, "storeState", {} ) ) } ) } )