How to get hold of the data in the nested array?

I am trying to build a report in Tempo but I am getting stuck on how to get hold of the data in the nested array. Here is an example of what I am working with along with the report I have built so far. Should I restructure my CDT or is it possible to get the results I want?

CDT defined Data Store Entity
Items--value1
value2
           array--a1 (Milestone Name - start, middle, end)
           a2 (Boolean status - true, null, null)
                     a3 (Datetime Stamp - datetime, datetime, datetime)
                              
Display in SAIL report as:
value1 - value2 - a1 - a2 - a3

load(
local!arrayPaging: a!pagingInfo(
startIndex: 1,
batchSize: 20
),
with(
local!arrayData:
todatasubset(
rule!FetchArray(
ri!matchingid
),
local!arrayPaging)
,
a!gridField(
label: "Display in SAIL report",
totalCount: local!arrayData.totalcount,
columns: {
a!gridTextCol...

OriginalPostID-168593

OriginalPostID-168593

  Discussion posts and replies are publicly visible

Parents
  • @james.franklin The way how I generally do it is by creating a formatted rule:

    getConcatenatedListForMultipleItems
    1. list (Any Type)
    2. column (Text)

    Definition:
    if(
    \trule!APN_isEmpty(index(ri!list,ri!column,null)),
    \tnull,
    \tjoinarray(index(ri!list,ri!column,null),"; ")
    )

    And you could invoke the above formatted rule as follows:
    a!gridTextColumn(
    label: "a1",
    field: "a1",
    data: apply(rule!getConcatenatedListForMultipleItems(_,"a1"),local!datasubset.data)
    ),
    a!gridTextColumn(
    label: "a2",
    field: "a2",
    data: apply(rule!getConcatenatedListForMultipleItems(_,"a2"),local!datasubset.data)
    )

    But again I guess making a reusable rule may not work all the times, because each column will have its own formatting style, such as a boolean might need to be represented as Yes/ No, a date time might need to be represented as DD MMM YYYY HH:MM etc. Not sure how far this is correct but let's see if any other practitioner comes up with better suggestions.

    Just to let you know why we need to do above is, the data provided to a!gridTextColumn is flattened automatically as far as my knowledge is considered and some times it could be also a problem when it is accessing an array of arrays. So that's why we need to build a formatted rule which outputs the data exactly that matches the number of rows in a page.
Reply
  • @james.franklin The way how I generally do it is by creating a formatted rule:

    getConcatenatedListForMultipleItems
    1. list (Any Type)
    2. column (Text)

    Definition:
    if(
    \trule!APN_isEmpty(index(ri!list,ri!column,null)),
    \tnull,
    \tjoinarray(index(ri!list,ri!column,null),"; ")
    )

    And you could invoke the above formatted rule as follows:
    a!gridTextColumn(
    label: "a1",
    field: "a1",
    data: apply(rule!getConcatenatedListForMultipleItems(_,"a1"),local!datasubset.data)
    ),
    a!gridTextColumn(
    label: "a2",
    field: "a2",
    data: apply(rule!getConcatenatedListForMultipleItems(_,"a2"),local!datasubset.data)
    )

    But again I guess making a reusable rule may not work all the times, because each column will have its own formatting style, such as a boolean might need to be represented as Yes/ No, a date time might need to be represented as DD MMM YYYY HH:MM etc. Not sure how far this is correct but let's see if any other practitioner comes up with better suggestions.

    Just to let you know why we need to do above is, the data provided to a!gridTextColumn is flattened automatically as far as my knowledge is considered and some times it could be also a problem when it is accessing an array of arrays. So that's why we need to build a formatted rule which outputs the data exactly that matches the number of rows in a page.
Children
No Data