Ask Your Question
0

I want to import data from a rest api into a regular table

asked 2018-09-18 19:29:14 +0200

eagle275 gravatar image

as in the headline I have a personalized rest api - which delivers a set of data either in json or in csv form via a get request. When I use sheet-> link to external data ...insert the get-url into the source and press enter , libre office opens another window where I see the data I want to use .. and it gives me options for delimiters and so on .. but when I OK out of that window .. the OK in the next window is greyed out ... How do I make use of the obviously existing data of the rest api request ?

thanks for all hints

edit retag flag offensive close merge delete

2 Answers

Sort by » oldest newest most voted
0

answered 2018-09-19 01:27:48 +0200

Ratslinger gravatar image

Hello,

To my recollection you won't be able to accomplish that using Sheet->Link to External Data.

On-Line documentation - Inserting External Data in Table (WebQuery). Note Step #4 (Inserting by Dialog) where you need to select a named range or table.

To use JSON or CSV you probably need to code your own macro. See the following for a bit more info:

Link to External data from website not working

Import from REST API to Calc

Link to external data does not work

edit flag offensive delete link more
0

answered 2018-09-19 11:41:31 +0200

eagle275 gravatar image

Thank you for your answer.. Its annoying that LibrteOffice cant compare to Excel in that regard.. Do the developers seriously think "copying" existing tables from websites is all what people need?

I was able to circumvent LibreOffices stupid limitation to "webqueries" by setting up a small website using php on my local pc that imports the json data and "draws" them into a html table .. quick'n'dirty ... Now I face only one problem ...

As the rest-api is 1) personal and 2) reqquires a kind of "currency" per request. I dont want to burn the requests I have available too fast.. So I put in a caching method that saves the results and only when called with a special parameter the site will update . BUT a small problem remains to make it "beautiful" I put in a field to connect to "Open Hyperlink" .. and LibreOffice displays "ctrl+click to follow the link" .. which starts a browser with said website .... can I somehow make that "silent" without going to a browser window?

edit flag offensive delete link more

Comments

Please do not use an answer to respond. Instead use a comment or if more space needed edit your original question and note the edited information.

The link is doing what it is intended to do - takes you to the link. Not exactly certain what you are doing but if you want to access "silently", use a macro. Possible example -> here.

Ratslinger gravatar imageRatslinger ( 2018-09-19 17:28:16 +0200 )edit

Just re-read you comment & probably didn't understand the first time. Since you now have the data in an HTML table why not just connect using Link to external table?

Also not sure as to why not just write a simple Python macro for Calc to retrieve the JSON data when needed.

Ratslinger gravatar imageRatslinger ( 2018-09-19 23:18:46 +0200 )edit
Login/Signup to Answer

Question Tools

1 follower

Stats

Asked: 2018-09-18 19:29:14 +0200

Seen: 1,056 times

Last updated: Sep 19 '18