My requirement is as below:
I have a set of Ids, and using an integration I am getting all details of the records of those Ids. After certain manipulation of the dataset, i am displaying the dataset on a grid.
Now I want to download the same grid to an excel/csv document.
Please note, I am not saving the data in any table so I can't use export to csv from DSE option.
What I have tried is using an document WebApi where I pass my Ids and get the details and download the document.
The problem with this approach is: 1) I have to call the integration again and do those manipulations again
2) The Ids I am passing as query parameters. When there are more than 1000 ids, the url is becoming too long and the API is failing.
Can anyone please suggest an alternative approach to resolve this issue
TIA
Discussion posts and replies are publicly visible
Doing all this data manipulation in memory seems not to be a great idea. But regardless of this, I do not see a way to achieve this in a single user interaction.
Can you suggest any other option
For what? The data manipulation? Currently the best option in terms of speed and resource consumption is a table in the database. Then the API CSV download approach would work as well.
I need a suggestion on how to generate the document. Having data in the database is not an option. We don't save the data in Appian. The only way to retrieve the data is using an integration
Yeah, well ... I would challenge this "requirements". And I still do not see a way to achieve this in a single user interaction.
>>2) The Ids I am passing as query parameters. When there are more than 1000 ids, the url is becoming too long and the API is failing.
In that case, pass the Ids in the request body.
So I am using the web api url in the link field of an interface. At the end of the url i am passing the case Ids which is becoming the query parameters. If I have to pass them in the request body, can you suggest how do i pass the case Ids using the url. It would be very helpful if you can send a sample code
Normal HTML Links do not support a HTTP body.
Are you using third party webapi? You need to ask webapi developer to change the api code to start including the large set of ids into request body instead as a query parameter.
So I took all of your suggestions, and here's what I did:
1) Created a post WebApi in Appian to download document (So that I can pass the Ids in body)
2) Created an integration to call the API
3) Created a process model to call the integration and save the document Id in a process variable
4) Used a!startProcess synchronously in the interface to call the process and saved the document id in local variable. This action was done using a button
5) Used the document id in a document download link. Finally able to download with two clicks
After all this, I am still failing to generate the document using web api when the number of Ids go beyond a certain value. This is mainly because the webapi itself is calling another integration which is timing out because of large data.
Another approach that I was to pass the cdt (which contains all the details) into the body of the web api in json format. In that case, the web api doesn't need to call another integration.
This approach seemed to be working