Avoiding undesired font when pasting a table from javascript code to calc

I’m trying to simultaneously avoid both of two problems when pasting a table (that I produce in javascript code) into libreoffice calc:

  1. The font is changed to Liberation Serif in all methods that don’t display the text import dialog.
  2. I don’t want to need to answer the text import dialog.

There should be many ways to skin this cat, but I can’t get any of them to work:

A) I thought there used to be an option somewhere to paste unformatted text without bringing up the text import dialog. But I can’t find that now. I’m using version 25.8.6.2 on Fedora 43.

B) It must be getting its choice of Liberation Serif from somewhere. If I could change that setting, that would deal with the problem. But I can’t find that setting.

C) If have copied a table from calc itself and examined the mime details on the clipboard, and changed my javascript to come as close to matching that as I can. But calc still ignores all formatting in the clipboard object I create, while obeying the formatting in the object it created itself. Is there any way for an external program to put a table on the clipboard with formatting calc will obey? Or does calc bypass the clipboard when pasting something it copied, and lack the ability to paste the same thing correctly from the clipboard?

Liberation Sans works well for me in everything else. I don’t know where that default is coming from, but for new sheets and paste of unformatted text, I get Liberation Sans, which I like. Pasting a table from html ignores that table’s formatting and changes all the fonts to Liberation Serif, which I’m trying to avoid.

may be avoid all this indirection via clipboard and produce whatever directly from Libreoffice!?
there are Interfaces from Libreoffice for [ python, javascript, beanshell and basic ]

Thankyou, but I don’t think I can.
The source of the tables is my brokerage account. It is data that the brokerage won’t export in any reasonable format, so I used tampermonkey in my browser to scrape and organize the data and write it to the clipboard.
I am open to suggestions, if there is some better way for a tampermonkey script to push data to a libreoffice calc spreadsheet (that is open at the same time) or some better way for a libreoffice spreadsheet to pull data from a web page that is logged into my brokerage account. For either of those, I don’t yet even know enough to start looking.

You could try to save as or append to a simple csv-file.
That could be used as a permanent datasource for Base/Calc.

Writing to a .csv file (instead of the clipboard) is the easy part (for me), but thankyou for the link (since you couldn’t know I knew that part).
But used as a “permanent datasource for Base/Calc” is still a mystery to me even after googling that phrase and reading some of what I found (which didn’t seem to fit using a csv).
That path (permanent datasource) feels like a big project to even find out what it might do for me.
Is there some clearer explanation you could link to for that side of it?

But I’d still like to know if there is some answer along the original path I asked about (get better paste behavior via something done either within calc or in the contents I write to the clipboard).
(I already ruled out my idea C from the original post as I discovered calc doesn’t use the html type at all when pasting from its own copy operations).

The key element to know: Base can treat a folder of csv-files as database. Every csv-file is a table of the database and lines of the files are records.

  • You need at least one csv-file in a folder
  • In LibreOffice from menu File select New>database and then you choose to “connect to an existing database” of type text
  • Set the folder (not an individual file) as database and adapt settings like separator according to your needs.
  • Save the database (this creates a .odb-file where Base finds the connection to the folder). Register the database, if you like.
  • You may now create simple sql-queries for the data in Base if necessary
  • Now drag a query or table from Base to a new Calc-sheet (a1) and this will create a database-range in Calc. It will have a copy of the data from the csv. Save the Calc-file as .ods.
  • Data will not update automatically, if you change the csv, but from Menu Data you can select “refresh range” for a manual refresh, and this can also be done by macro.

.
Connect to database:
https://help.libreoffice.org/latest/en-US/text/sdatabase/dabawiz01.html?&DbPAR=BASE&System=UNIX

Text-File-configuration:
https://help.libreoffice.org/latest/en-US/text/sdatabase/dabawiz02text.html?&DbPAR=BASE&System=UNIX