Creation of dynamic excel document in Appian

Certified Associate Developer

Is it possible to create a dynamic Excel in Appian?

Let me describe the challenge I am facing.

I need to create a dynamic Excel in Appian that would have 10 different tables, each of which is displayed based on dynamic input (list of IDs 1,2,...10),

possible scenarios

a) If we pass 1,2, and 10 the tables with serial numbers 1, 2, and 10 should be displayed,
b) if we pass all numbers, all 10 tables should be displayed, 
c) If we pass numbers from 1 to 5, only the first 5 should be displayed and so on.

An example of the code we used to generate the Excel:

local!dictionary: cast('type!{www.appian.com/.../2009}Dictionary', {}),

local!dataExport: a!forEach(
items: local!labelValue,
expression: reduce(
fn!insert(_, _, _),
local!dictionary,
merge(
index(fv!item, "data", null),
index(fv!item, "value", null)
)
)
),

'type!{urn:com:appian:ps:excel:types}ExportableDataSubset'(
fieldLabels: index(local!labelValue, "label", null),
fieldNames: index(local!labelValue, "value", null),
datasubset: todatasubset(local!dataExport),
filename: "Data inputs_"&local!currentTime
)

The problem with this is that we can't do any functions or calculations within cells and rows.

Also, everything has to be pre-filled to work properly.

This is a sample excel that we are currently generating. Such a solution is not good enough for us due to the complexity of the request.

We get the values ​​from the database or rule and just pass them to Excel.

Please give me some advice and a solution on how to do this.

  Discussion posts and replies are publicly visible

Parents
  • 0
    Certified Lead Developer

    You can create an excel template with 10 sheets - each sheet having cell headers as table 1 ,2 ,3 till 10. Then configure process model to populate the sheets with respective table's data as user selects whether it is 1,2 and 10 or 1 till 5 etc. At the end of process delete the sheets which user didn't select(they will be blank anyway) so your final excel will have different sheets, each having data from the table which user selects. 

Reply
  • 0
    Certified Lead Developer

    You can create an excel template with 10 sheets - each sheet having cell headers as table 1 ,2 ,3 till 10. Then configure process model to populate the sheets with respective table's data as user selects whether it is 1,2 and 10 or 1 till 5 etc. At the end of process delete the sheets which user didn't select(they will be blank anyway) so your final excel will have different sheets, each having data from the table which user selects. 

Children
No Data