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

Parents
  • 1) I will suggest to take a look at a simpler version of the component (see the references I added at the bottom)

    2) Can you confirm somethings:
    * I am guessing the first column is showing proper information?
    * which component are you using, for me it sounds like gridField?

    2.1) Since the columns are shown and the data information is not shown,
    I am guessing this is the "gridField" then it might be as simple as the value/data you are passing but it always depends on the component you are using. in this case try this:
    2.1.1) The data field/parameter should be a list
    a!gridTextColumn(
    label: "Field",
    field: "field",
    data: index(ri!dataSubset.data,"field",{} )
    )
    2.1.2) if you are using a rule this maybe is not returning a list it self
    a!gridTextColumn(
    label: "Field",
    field: "field",
    data: a!forEach(
    items: index(ri!dataSubset.data,"field",{} ),
    expression: rule!someRule(param: fv!item)
    )
    )


    2.2) if it were the component "gridLayout" try this:
    * first to show the same information from the first column ( the one you already have)
    * check if you don't have a showWhen to false or if the data is not null

    4) If previous things are correct then make sure the data is not null.


    5) As a reference you can take a look at this links
    Paging Grid - SAIL Function: a!gridField()
    * docs.appian.com/.../Paging_Grid_Component.html
    Editable Grid - SAIL Function: a!gridLayout()
    * docs.appian.com/.../Editable_Grid_Component.html


    If nothing of this works please let us know
  • 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 trying to display a picture of the grid, but it will not let me
  • 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.
Reply Children
No Data