Insert Field [CTRL + F2] > variables > Set Variable - insert button greyed out

I would like to insert a text format field via ‘Set variable’. I am not able to do so, the Insert button is greyed out and disabled, despite my attempts.

This occurs on a newly created document, as well as one I am trying to work on. running 24.8.4.2 on Windows 10.

Try giving a name, a value and double-click on the selected format.

What do you mean wit text format field? How do you intend to use it?

@mariosv Did not work for me - clicking around in “Additional formats…” I occasionally am getting an active “insert” button, but I am not able to effectively set and reference a variable this way. I suspect there is a bug that needs to be fixed.

I am able to create the desired field by renaming a test file to .zip, editing content.xml, and adding stuff like office:value-type="string" office:string-value="my stuff here" for the setting field. then renaming the file back to .odt

I am hoping there is a way to do this without resorting to such direct tinkering in the file

@ajlittozI need a variable to store text, that I can display the contents of, and redefine within the document.

I am making a standard format footer for a master document, there will be many similar sub-documents. I want to (re)define a variable that will be displayed in the footer, so I don’t have to manage a bunch of similar footers. I also intend to display the variable in other parts of the document.

I am following this:

here is another person [edit: I see this was you] on a similar track, although I am not trying to do the conditional stuff with hidden paragraphs:

As you have found out, I filed a bug about header/footer generation. It may be that header/footer are cached first time they are met (created) and never interpreted again afterwards when they are used, at least variable-wise. The only reliable way to get a “dynamic” header/footer is with fields referencing headings.

Explain more thoroughly what you want in your footer. Describe it from author’s or reader’s point of view. I.e. don’t do in implementation terms (I insert a variable) but tell which information is to be shown (I want to repeat the chapter title or …). I can then suggest a real solution or an acceptable workaround.

Be aware that the master+subdocs context complicated matters. This requires smart configuration of styles (in your case page styles) and you must understand the precedence rules. Usually, this is handled by the reference to a common template so that all files share the same styles. This is not mandatory but eliminates the most frequent problems.

EDIT: provide an example file so that I can study your case.

@ajlittoz I believe setting and getting variable fields will get me what I want in the footer, no need to review that - as it sits, I can’t even get these fields into the body of a brand new odt document via LibreOffice because the Insert button is disabled and grayed out on my system. My workaround for the task at hand will regrettably probably be manually editing the content.xml as indicated in my reply to @mariosv unless something better materializes in the next day or two. I’ll attempt to find a way to clearly present this for a formal bug report so the libreoffice programmers can assess the behavior.

Your complaint rang a bell in my memory. Consequently I experimented a bit with my 24.8.4.2 under Fedora 41, KDE Plasma desktop.

You’re right: the Insert button remains disabled, but I found a workaround.

  1. Enter needed data in the dialog.
    The button is still disabled.
  2. Click somewhere in the background document window.
  3. Click again in the dialog.
    The button is now enabled.
  4. You can click Insert.

This is clearly a regression bug.

Thanks, that worked - I will file a bug report

tdf#164676