Hello Everyone! We have a Tempo Report with 2 different flavors of Ex

Hello Everyone!

We have a Tempo Report with 2 different flavors of Export Data to Excel-

1. An Export to Excel link allow users to export data to excel while being on the report interface
2. A Send Email button that sends email with the data attached.

We are using 'getdatasubsetdownloadlinkfromrule' for the export link and 'Export CDT To Excel' for Send Email functionality.

This report has few date fields. The default date format returned by 'Export CDT To Excel' smart service is 'dd-mmm-yyyy'.
But the export link on the report returns the default Appian date format which is 'mm/dd/yyyy'.

User's are experiencing an inconsistency in the date formats which we would like to address.
Any inputs on how we can resolve this issue to have the date format consistent across the interface?

OriginalPostID-204746

OriginalPostID-204746

  Discussion posts and replies are publicly visible

  • 0
    Certified Senior Developer
    Hi Preetam,
    You can convert the date field into text by tostring(date_field) in desired date (as text) format and then pass this field into export to excel. It consider the date field as text and not convert the date format in the excel.
  • Hi Preetam,

    On way to do this is to create an expression rule to convert an input date into 'dd-mmm-yyyy' format and use this rule to change the format of your date fields, whenever you are generating the datasubset for the excel through getdatasubsetdownloadlinkfromrule plugin. A sample code for the rule :

    concat(day(ri!inputDate),"-",month(ri!inputDate),"-",year(ri!inputDate))

    But the CDT which you are using for export should have all those date fields as 'text' data type (to accommodate a value of 'dd-mmm-yyyy' format). For this, you can make a temporary CDT and use that in place of the original one while generating the datasubset for Excel.
  • @preetamb Hopefully I am correctly understanding your circumstances here, but it seems like this is a problem that can be solved using the available infrastructure of your smart service (or possibly link for that matter).
    In the smart service when you configure your inputs for fields to export, in the Value section rather than simply putting the CDT field, you can write an expression that will manipulate the data in the field, something to the effect of, rule!APP_convertDateFormat([yourdata]). That way what gets exported to excel will be the date in the format you want. In the event that the data that ends up in the spreadsheet is still in the wrong format, see whether that is simply from a date-formatting default setting of Excel.
    Conversely, depending on what options you have for passing data using the export link, you could instead modify the data that you pass to the export link using a rule you have created for that purpose (again something like rule!APP_convertDateFormat([yourdata])). If the link doesn't have that functionality, you could also simply alter the format in which your data is displayed on the report (again using a simple rule) so that when it exports it is already in the correct format.
    I hope this helps. Just let me know if you would like any further explanation on anything I've said.
  • This is how we have used it in our project