21
Views
1
Comments
Getting response from GET API, create a JSON file with the data, display data as file
Question

Hey everyone, 

I'm creating a reactive app which has: an input field, a button. 

The input field takes a project ID and when you click the button it will retrieve that project's data (json format).

I want to be able to take that data and create a .json file, then display that json file into a table which is then downloadable. 

What I am able to do separately but having a hard time trying to put them all together. 

  • I'm able to dynamically pass my input field var into the api and get a response. 
  • on a different screen, I am able to input a file, "upload", which then displays that file into a table on this screen. Once it's displayed I am able to download that file. 

What I'm having trouble doing is:

  • wrapping the data from the api response into a json file, then displaying that file into a table (like in my second bullet point).

Can someone help or send me some resources/docs to accomplish this?

Thank you

Hello Alex,

You can save response of your API as string into database Entity (in case you using database entity to save data) or use response directly into second screen.

When user click download file you will retrieve JSON string and convert it to binary then use download widget into you action to download file with extension "json".

Please check answer of following post :

https://www.outsystems.com/forums/discussion/70720/export-to-text-file/

Community GuidelinesBe kind and respectful, give credit to the original source of content, and search for duplicates before posting.