Skip to main content
thulasik7152
New Participant
Apr 5, 2023 4:50 AM UTC
Question

How to export stored procedure data subset to excel?

Hi Team,

Here I want to pass parameters dynamically from Appian to the stored procedure and get the data subset, then export that data subset to Excel. I have created a stored procedure, and when I tested passing dynamic fields and data, I am getting results. Now I wanted to export this data subset to Excel, so I tried using the "Export SQL to Excel" smart service. But I am getting the following error: "The following error was raised by the Export to Excel function: null"

Is there any other smart service to export data subsets to Excel? Please advise. Thank you!

3 replies

adityag9712
Inspiring
Apr 5, 2023 2:56 PM UTC

Hi, 

Here you can try building the your sql query in a script task and pass that query in Export SQL to Excel.

- Aditya
abhayd3663
Brainy
Apr 5, 2023 3:30 PM UTC

It will be easier to generate a database view from the the result set returned by the stored proc and then use the db view to export data into excel.  

mikes0011
Brainy
Apr 5, 2023 3:34 PM UTC

Should be as simple as using the Export CDT to Excel node, after querying your stored procedure output into a CDT.  It doesn't even have to be a really special CDT or anything, you can just create a dummy CDT with a dozen or so plaintext columns (allowing you to reuse it for several things).

The Expression Guru