I installed the getdatasubsetdownloadlinkfromrule, and exporting my report to Ex

I installed the getdatasubsetdownloadlinkfromrule, and exporting my report to Excel.

In my rule I have a field name (ex:LEAD_CONTACT) that comes out as a username when I export to Excel. How do I apply the user function to fetch the full name within this rule?

= with(
'type!{urn:appian:plugin:datasubsetdownload:types}ExportableDataSubset'(
filename: "Exported Data",
fieldNames: {
"LEAD_CONTACT"
etc....

OriginalPostID-202498

OriginalPostID-202498

  Discussion posts and replies are publicly visible

  • @mjmallet To the best of my knowledge, one of the (can be the only as well) preferred ways to do so would be to hold the formatted data in the datasubset attribute.

    Let's say you do have a rule that returns 'Products' data but you want the formatted values for some of the fields in it. Then you may do something as follows:


    with(
    \tlocal!actualProducts: rule!getAllProducts(),
    \t/* Assume that the actual data contains product type id, but we want to derive product type name */
    \tlocal!formattedProducts: apply(
    \ ttype!myFormattedProduct(
    \ tid:_,
    \ tname:_,
    \ tproductTypeName:
    \ t),
    \ tmerge(
    \ tlocal!actualProducts.id,
    \ tlocal!actualProducts.name,
    \ tapply(rule!getProductNamesFromProductTypeIds(_),local!actualProducts.productTypeId)
    \ t)
    \t),
    \t/* where type!myFormattedProduct() is a CDT(formatted CDT) created for storing the formatted data */
    \ttype!ExportableDataSubset(
    \t datasubset: todatasubset(local!formattedProducts,topaginginfo(startIndex: 1, batchSize: -1)),
    \t fieldNames: {"id", "productTypeName"},
    \t fieldLabels: {"ID", "Product Name"},
    \t filename: "Products"
    \t)
    )

    In order to format the data, you may opt for alternate ways such as creating a view and querying the same or may try to create a join temporarily using 'joinCdt' in 'CDT Manipulation' plugin. But the basic idea is to build the data in the datasubset of 'ExportableDataSubset' in such a way that it holds formatted data and thereafter you can start using fields in it as 'fieldNames'.