Export To Excel

Hello all,
we have created one Adhoc CDT[the type is list of dictionaries] ,when we pass the list of dictionary data the export CDT to excel smart service is return an error,
I want to know any other way to generate excel file with adhoc CDT data? ,
For cdt list data[getting data from db using query rule] the smart service working fine .
Example Adhoc CDT :
{{username:"test" , lastname:"user",username:"tuser",fullName:"testuser"}}

Thanks In Advance.

OriginalPostID-255025

  Discussion posts and replies are publicly visible

  • @venkateshs Hi, I believe creation of a formatted cdt(to hold the actual cdt contents plus formatted version of contents) is required because the smart service isn't able to recognise/unable any other type (such as 'List of Dictionary' type in your case) other than CDT as far as my experience is considered. Few options you can think of are as follows:

    1. Export SQL to Excel : You may opt for this if you have ALL of the data in the database(any formatting can be achieved through SQL functions) where a native SQL query drives your excel data set and you don't need to create a formatted cdt separately as we include the desired contents as columns in the query.
    2. CDT Manipulation plugin at http://bit.ly/28MEhax : fn!updateCdt() function in this plugin allows you to add a field to the cdt on the fly. Let the data set in the process be in the form of cdt and try applying this function so that you can have a cdt data set along with the new contents as desired by you but still of the same cdt type. I am not sure how far this works, but I think it might be worth giving a try.
  • Thanks for the response sikhivahan
    As you said For first option won't work because we don't have data in db .
    Second option : we have multi drop down filed, based on user selection we have created Adhoc CDT using fn!updateCdt() function[adding selected values as field].
    Whenever passing Adhoc CDT data it return an error because before generating the document the export cdt to excel smart service is checking wheather the cdt is available or not in system.
  • @venkateshs I was under the assumption that fn!updateCdt() returns the results in the same type of the source, however, I haven't checked this till date. Then I believe a formatted cdt is required in this case. Let's see what others opine on this.
  • You can also try creating datasubset using dictionary and use following plugin to get it exported to spreadsheet
    forum.appian.com/.../summary
  • @tajinder
    This plugin is for downladable link label in SAIL ,We want to generate excel file and send to some group in process level
  • One more option is like using "Cell_Keys" and "Cell_Values" inputs of the Export Excel smart services, in your case "Cell_Keys" should be generated dynamically.
    Suppose I have 3 process variables pv1={1,2,3},pv2={"abc","lmn","xyz"} and pv3={1000,2000,3000}(in your case dictionary data) and now if you want to export these process variables data to excel file without using CDT, then you have to give cell keys like {"A1","A2","A3","B1","B2","B3","C1","C2","C3"} in the "Cell_Keys" section and have to give pvs {pv1,pv2,pv3} in the "Cell_values" section.But here I have given static Cell keys because I know the length of each pv.
    In your case you have to write an expression rule in such a way that it takes length of the each pvs as inputs and generate Cell keys based on the length of the each pv dynamically.

    Just like this, pv1={1,2,3,4,5}, pv2={"a","b","c","d","e"},pv3={100,200,300,400} then your rule should return keys like {A1,A2,A3,A4,A5,B1,B2,B3,B4,B5,C1,C2,C3,C4} in text array, observe I have given 4 vaues in pv3 and generated 4 keys for the third column.

    Hope this reference will help you to go with your requirement without using CDT.

    Thank you.
  • It might be better to opt for a formatted CDT as I personally opine that the above-mentioned approach over complicates the things. This is especially true in the case when the template is bit fancy requiring the data to be populated based on the Cell Keys/Values AND CDT fields to export. That is, the way we form the Cell Keys/Values becomes complicated when we want to cover both the fields in CDT and some particular cell mappings. In this case, it might be better to stick with a formatted CDT which keeps things simple and also provides an option for reusing the same CDT in any other similar implementations.
  • As @sikhivahan said that approach will complicate , if we really want particular excel template format we can go with approach,
    @sikhivahan,anjannat Thanks for the response
  • Yes, I can agree with guys that this is a complicated process especially if there is a huge amount data that you want to export(I have used it in my previous project with medium range of data).
    But as @venkateshs329 said in the above comments that he is facing some issues with converting anonymous CDT(Dictionary) to formatted CDT while using Export CDT to Excel, cannot use Export SQL to Excel smart service and cannot even use "Download DataSubset" plugin so thought of using this alternative solution which is a least priority.

    Thank you.