Cannot display the rest of the fields in a grid

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

  • Boise Boise Boise Boise Boise
    BON BON BON BON BON
    BTW BTW BTW BTW BTW
    Des Moines Des Moines Des Moines Des Moines Des Moines
    IA IA IA IA IA
    ID ID ID ID ID
    s1 s1 s1 s1 s1
    s2 s2 s2 s2 s2
    Store One Store One Store One Store One Store One
    Store Two  Store Two Store Two Store Two Store Two
  • This is the grid that displays if I search for the word "store" in the grid.
  • I guess you are getting everything as an array,


    try this
    <<<<<<<<<<<<<<<<<<<<<<

    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"}
    } ,
    <<<<<<<<<<<<<<<<<<<<<<
    a!forEach(
    items: local!entities ,
    expression: 'type!{urn:com:appian:types:stores}stores_Entity'(
    Name: index(fv!item,"Name","-") ,
    storeid: index(fv!item,"storeid","-") ,
    storeSymbol: index(fv!item,"storeSymbol","-") ,
    storeCity: index(fv!item,"storeCity","-") ,
    storeState: index(fv!item,"storeState","-")
    )
    )
    <<<<<<<<<<<<<<<<<<<<<<
  • Doing that creates a blank grid with no information
  • 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",
              {}
            )
          )
        }
      )
      
    }
    )

  • Would the sort info in the gridSelection have something to do with why nothing is displaying?
  • I don't think that the sorting has something to do with it, if you have doubts just remove/comment the sortInfo, it doesn't affect the information displayed.