I get the firstname and lastname in a single row, whereas the outcome should be one value per row

Hello ,

I am trying to create a report, with a document download link using: getdatasubsetdownloadlinkfromrule,
I am able to display the data in excel sheet, there are 1 cdt, which has 4 fields, app,group, firstname and lastname, out of which firstname and lastname are of multiple type.
The problem is I get the firstname and lastname in a single row, whereas the outcome should be one value per row, I have verified the length of that cdt.firstname, it returns the exact number of lenght, but in excel it is showing as a row
Let meknow what am i missing, below is the code snippet:

In main rule:

local!linkdata: todatasubset(local!cdt, local!pagingInfo1),
                    local!ruleURI: getdatasubsetdownloadlinkfromrule(rule: rule!GenerateExcelRule, input: tostring(a!toJson(local!linkdata))),

In subrule:
=with(
local!search: a!fromJson(ri!input),
'type!{urn:appian:plugin:datasubsetdownload:types}ExportableDataSubset'(
filename: "Exported Data",
fiel...

OriginalPostID-142594

OriginalPostID-142594

  Discussion posts and replies are publicly visible

Parents
  • Try this:

    local!ruleURI: getdatasubsetdownloadlinkfromrule(rule: rule!GenerateExcelRule, input: a!toJson(
                        {
                        app: ri!app,
                        group: ri!group,
                        firstname: joinarray(local!cdt.firstname,"|"),
                        lastname: joinarray(local!cdt.lastname,"|")
                        }))

    inner rule:

    =with(
    local!pagingInfo1: a!pagingInfo(startIndex: 1, batchSize: -1),
    local!search: a!fromJson(ri!input),
    local!newData: apply(
                                                                rule!generatecdt,
                                                                merge(
                                                                split(local!search.firstname,"|"),
                                                                split(local!search.lastname,"|")
                                                                ),
                                                                local!search.app,
                                                                local!search.group
                                                                ),
    local!DataSubset: todatasubset(
    local!newData,
    local!pagingInfo1
    ),
    'type!{urn:appian:plugin:datasubsetdownload:types}ExportableDataSubset'(
    filename: "Exported Data",
    fieldNames: {
                        "app",
    "group",
    "firstname",
    "lastname"
    },
    fieldLabels: {
                        "app",
    "Group",
    "FirstName",
    "LastName"
    },
    datasubset: local!DataSubset          )
    )



    Also in rule!generatecdt update sequence of inputs:

    firstname
    lastname
    apps
    groups
Reply
  • Try this:

    local!ruleURI: getdatasubsetdownloadlinkfromrule(rule: rule!GenerateExcelRule, input: a!toJson(
                        {
                        app: ri!app,
                        group: ri!group,
                        firstname: joinarray(local!cdt.firstname,"|"),
                        lastname: joinarray(local!cdt.lastname,"|")
                        }))

    inner rule:

    =with(
    local!pagingInfo1: a!pagingInfo(startIndex: 1, batchSize: -1),
    local!search: a!fromJson(ri!input),
    local!newData: apply(
                                                                rule!generatecdt,
                                                                merge(
                                                                split(local!search.firstname,"|"),
                                                                split(local!search.lastname,"|")
                                                                ),
                                                                local!search.app,
                                                                local!search.group
                                                                ),
    local!DataSubset: todatasubset(
    local!newData,
    local!pagingInfo1
    ),
    'type!{urn:appian:plugin:datasubsetdownload:types}ExportableDataSubset'(
    filename: "Exported Data",
    fieldNames: {
                        "app",
    "group",
    "firstname",
    "lastname"
    },
    fieldLabels: {
                        "app",
    "Group",
    "FirstName",
    "LastName"
    },
    datasubset: local!DataSubset          )
    )



    Also in rule!generatecdt update sequence of inputs:

    firstname
    lastname
    apps
    groups
Children
No Data