I am trying to display a multiple text field in a SAIL gridField (Record Dashboa

I am trying to display a multiple text field in a SAIL gridField (Record Dashboard). My field contains multiple text values separated by ; .
My SAIL code doesn't work:
          a!gridField(
                    label: "Event Logs",
                    columns: {
                     rule!APN_uiGridTextColumnAuto(
                              label: "Description",
                              data: rf!logs,
                              alignment: "LEFT"
                     )
                    },
                    value: {
                     startIndex: 1,
                     batchSize: 6
                    }
          )
Expression evaluation error in rule 'apn_uigridtextcolumnauto' (called by rules 'apn_uisectiononecolumn' > 'hrp_uploadpanelcsv'): Invalid index: Cannot index property '' of type Text into type List of Text String (APNX-1-4198-000)

Any suggestions?
Thank you

OriginalPostID-167779

OriginalPostID-167779

  Discussion posts and replies are publicly visible

  • 0
    Certified Lead Developer
    I'm not quite sure why you're using rule!APN_uiGridTextColumnAuto here. You should just be able to use a standard a!gridTextColumn - but you'll also need to set the value property for the gridfield to a pagingInfo variable or type (you're currently defining a dictionary type) and define the totalCount property for the grid so that the gridfield actually works.
  • Could you send me an example with more details please? Thank you again!
  • @danielem You could use 'APN_uiGridTextColumnAuto' but the rule would render you the desired output if the input data is in label value pairs, i.e. similar to cdt structure.

    rule!APN_uiGridTextColumnAuto(
    \tlabel:"BPM",
    \tdata:{{name:"Pega"},{name:"Appian"},{name:"Bonita"}},
    \tfield:"name",
    \talignment:"LEFT"
    )

    But until and unless there is a good reason (To the best of my knowledge, especially APN_uiGridTextColumnAuto is intended to use as part of APN_uiPagingGridAutoColumns), it would be good to proceed with using a!gridTextColumn as specified by Phil.
  • 0
    Certified Lead Developer
    load(
    local!pagingInfo: a!pagingInfo(
    startIndex: 1,
    batchSize: -1
    ),
    a!gridField(
              label: "Event Logs",
              totalCount: 6,
              columns: {
               a!gridTextColumn(
                        label: "Description",
                        data: {"logs1","logs2","logs3","logs4","logs5","logs6"},
                        alignment: "LEFT"
               )
              },
              saveInto: local!pagingInfo,
              value: local!pagingInfo
    )
    )
  • @danielem As you say that 'rf!logs' is of type Multiple Text, the above pointers specified holds good, when you convert the data type to a label value format.
  • 0
    Certified Lead Developer
    If anyone's interested, I've devised a new example (based on philb's above, thanks) that takes the plaintext array rule input (here named ri!textArray), and enabled paging and sorting on-form.

    Note: I use updateCDT (found in "CDT Manipulation" plug-in) in this example just to get the plaintext array stored into a CDT-style local variable, though if anyone has a more elegant way to do so I'd be interested to see it. In all other ways, though, the following code is working.

    (I set the paging break size to 3, for demo purposes, but for general use it can be set to something less annoying)

    =load(
    local!pagingInfo: a!pagingInfo(
    startIndex: 1,
    batchSize: 3,
    sort: a!sortInfo(
    ascending: true(),
    field: "text"
    )
    ),

    local!cdtArray: updateCDT(
    cdt: repeat(
    length(ri!textarray),
    { text: "" }
    ),
    fieldsAndValues: {
    text: ri!textarray
    }
    ),

    with(
    local!dataSubset: todatasubset(
    local!cdtArray,
    local!pagingInfo
    ),

    a!gridField(
    label: "Event Logs",
    totalCount: local!dataSubset.totalCount,
    columns: {
    a!gridTextColumn(
    label: "Description",
    data: property(local!dataSubset.data, "text", {}),
    field: "text",
    alignment: "LEFT"
    )
    },
    saveInto: local!pagingInfo,
    value: local!pagingInfo
    )
    )
    )