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

  • Are the columns themselves not displaying, or just the data within them?
  • 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.

  • Also,

    I noticed you had a foreach in the 2.1.2. There is also a main form that is calling this grid.

    Here is some code from that form.
    local!data: if(
    rule!AF_RULE_General_isBlank(
    local!unSelectableEntityData
    ),
    local!stores,
    if(
    local!unSelectableEntityData.totalCount = 0,
    local!stores,
    remove(
    local!stores,
    wherecontains(
    touniformstring(
    {local!unSelectableEntityData.data.Name, local!unSelectableEntityData.data.storeID}
    ),
    local!stores
    )
    )
    )
    ),

    local!filterData: if(
    rule!AF_RULE_General_isBlank(
    local!search
    ),
    {},
    index(
    local!data,
    where(
    like(
    lower(local!data),
    "*" & lower(local!search) & "*"
    )
    )
    )
    ),

    local!sampleData: if(
    rule!AF_RULE_General_isBlank(
    local!search
    ),
    {
    {}
    },

    {
    a!forEach(
    items: local!filterData,
    expression: 'type!{urn:com:appian:types:store}store_Entity'(
    Name: local!filterData[fv!index]
    )
    )
    }
    ),

    local!entityData: todatasubset(
    local!sampleData,
    local!gridSelection.pagingInfo
    ),
    local!selectedStoresData: todatasubset(
    local!selectedStores,
    local!gridSelection2.pagingInfo
    ),
  • 1) Can you try this? ans see what you get?
    a!gridTextColumn(
    label: cons!NMLS_TEXT_STORE_ID_LABEL,
    field: "storeID",
    data: index(
    ri!storeData.data,
    "storeID",
    "*We have not DATA *"
    )
    ),

    2) to make sure you get the information in the datasubset add a "paragraphField "
    ...
    a!paragraphField(value:ri!storeData.data),
    a!gridField(
    label: cons!NMLS_TEXT_SELECT_A_STORE_LABEL,
    ...

    This will tell you lot of information
  • 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.

  • hey this part you are just creating object with 1 field, the Name, then the other fields won't have values


    a!forEach(
    items: local!filterData,
    expression: 'type!{urn:com:appian:types:store}store_Entity'(
    Name: local!filterData[fv!index]
    )
    )
  • Yes sorry, I added another comment, let me check this
  • Actually, as I said this should be an array, thats why it prompted an error. Sorry about it return it to {} try the 2) option you will see the information ( please delte it when you finish)

    In the previous comment I noticed this.
    hey this part you are just creating object with 1 field, the Name, then the other fields won't have values
    a!forEach(
    items: local!filterData,
    expression: 'type!{urn:com:appian:types:store}store_Entity'(
    Name: local!filterData[fv!index],
    storeID: local!filterData[fv!index]
    )
    )

    It seems like the problem is on the information the grid is receiving.