# \[SOLVED\] How can I use the User's custom fields in an ODT document template?

**URL:** <https://www.dolibarr.org/forum/t/solved-how-can-i-use-the-users-custom-fields-in-an-odt-document-template/30153>\
**Category:** Developing for Dolibarr\
**Tags:** Extrafields, Users, ODT-Templates\
**Created:** [March 26, 2025, 6:27pm UTC](https://www.dolibarr.org/forum/t/solved-how-can-i-use-the-users-custom-fields-in-an-odt-document-template/30153 "2025-03-26T18:27:08Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![geppettvs](https://www.dolibarr.org/forum/user_avatar/www.dolibarr.org/geppettvs/32/4029_2.png) [@geppettvs](https://www.dolibarr.org/forum/u/geppettvs)\
**Post date:** [March 26, 2025, 6:27pm UTC](https://www.dolibarr.org/forum/t/solved-how-can-i-use-the-users-custom-fields-in-an-odt-document-template/30153/1 "2025-03-26T18:27:09Z")

</div>

I have created 2 extra fields which works like a charm in the User’s form.

Now I want to place these 2 extra fields in a customized ODT template, but I don’t see the information on how to call these fields in this handbook: [Create an ODT or ODS document template - Dolibarr ERP CRM Wiki](https://wiki.dolibarr.org/index.php?title=Create_an_ODT_or_ODS_document_template#User_information)

My current Dolibarr is 20.0.4

Any help or ideas is appreciated.

Thanks.

---

<div class="post-metadata">

**Author:** ![jonbendtsen](https://www.dolibarr.org/forum/letter_avatar_proxy/v4/letter/j/977dab/32.png) [@jonbendtsen](https://www.dolibarr.org/forum/u/jonbendtsen)\
**Post date:** [March 26, 2025, 6:41pm UTC](https://www.dolibarr.org/forum/t/solved-how-can-i-use-the-users-custom-fields-in-an-odt-document-template/30153/2 "2025-03-26T18:41:44Z")

</div>

Where on the template do you want to place the 2 extra fields, and would you mind sharing the extra field definitions?

I would also like to see an object where there are data in these extra field. A screenshot cutout would be fine.

---

<div class="post-metadata">

**Author:** ![geppettvs](https://www.dolibarr.org/forum/user_avatar/www.dolibarr.org/geppettvs/32/4029_2.png) [@geppettvs](https://www.dolibarr.org/forum/u/geppettvs)\
**Post date:** [March 26, 2025, 11:38pm UTC](https://www.dolibarr.org/forum/t/solved-how-can-i-use-the-users-custom-fields-in-an-odt-document-template/30153/3 "2025-03-26T23:38:34Z")

</div>

@jonbendtsen thanks for your quick response.

The Extra Fields were added to the user’s module:

 ![extra-field-1](https://www.dolibarr.org/forum/uploads/dolibarrorg/original/2X/c/cfe0c964d3c51605914b38b1e36e64c660da66dd.png)  
 ![extra-field-2](https://www.dolibarr.org/forum/uploads/dolibarrorg/original/2X/e/ec9aa11321c6a6ceac81a76c0d0bd0a4f86e76cb.png)

This is an example of user extra-fields with data (please notice “NO PERTENECE A UNA DIRECCIÓN” and “NO PERTENECE A UN DEPARTAMENTO” is an option in the extra-field.

 ![user-fields](https://www.dolibarr.org/forum/uploads/dolibarrorg/original/2X/c/c2362cb55aca5772ca9ff355f793d80a70e1f37e.png)

Here you can see the area where I want to place the extra-field 1, which must contain the “NO PERTENECE A UNA DIRECCIÓN” text.

 ![document-template-sample](https://www.dolibarr.org/forum/uploads/dolibarrorg/original/2X/1/1b1d63cd1f1c7a8147d9d0d36f48cb5d1627c8a4.png)

I don’t know how to call these user’s extra-fields.

Can you please guide me?

---

<div class="post-metadata">

**Author:** ![jonbendtsen](https://www.dolibarr.org/forum/letter_avatar_proxy/v4/letter/j/977dab/32.png) [@jonbendtsen](https://www.dolibarr.org/forum/u/jonbendtsen)\
**Post date:** [March 27, 2025, 7:30am UTC](https://www.dolibarr.org/forum/t/solved-how-can-i-use-the-users-custom-fields-in-an-odt-document-template/30153/4 "2025-03-27T07:30:59Z")

</div>

I don’t use extrafields on users. I do use them on proposals, orders, invoices. + on Projects.

I have them both on the object itself and on the object lines.

I don’t always display the content of the extra field on the PDF.

 ![image](https://www.dolibarr.org/forum/uploads/dolibarrorg/original/2X/f/fc7e354a7807f3461c766f8eed5716e74b7feee9.png)

As for the complementary attributes on lines, aka extra fields on lines, I only use the value 4.

Maybe this can somehow help. If I click send email on one of these objects and I click the little encircled i next to `Message` then I get a popup with a lot of variables I can use for inserting data into the email. Maybe it is the same with ODF templates?

 ![image](https://www.dolibarr.org/forum/uploads/dolibarrorg/original/2X/9/9b1033cbebfcf46c87e894aed427351fafcf026e.png)

---

<div class="post-metadata">

**Author:** ![jonbendtsen](https://www.dolibarr.org/forum/letter_avatar_proxy/v4/letter/j/977dab/32.png) [@jonbendtsen](https://www.dolibarr.org/forum/u/jonbendtsen)\
**Post date:** [March 27, 2025, 7:31am UTC](https://www.dolibarr.org/forum/t/solved-how-can-i-use-the-users-custom-fields-in-an-odt-document-template/30153/5 "2025-03-27T07:31:43Z")

</div>

My next reply will probably not be until Friday. Also, when you figure it out, please consider writing in here how to do it.

---

<div class="post-metadata">

**Author:** ![geppettvs](https://www.dolibarr.org/forum/user_avatar/www.dolibarr.org/geppettvs/32/4029_2.png) [@geppettvs](https://www.dolibarr.org/forum/u/geppettvs)\
**Post date:** [March 27, 2025, 5:05pm UTC](https://www.dolibarr.org/forum/t/solved-how-can-i-use-the-users-custom-fields-in-an-odt-document-template/30153/6 "2025-03-27T17:05:22Z")

</div>

@jonbendtsen, thanks for your support.

Your previous response gave me the idea and I thought that, if we can call the variable names with a standardized name, we should be able to do the same with the user’s extra-fields with using the same logic as per in the other modules.

So I went for:

1. {myuser\_options\_subdireccion}
2. {myuser\_options\_departamento}

The document template is now:

 ![imagen](https://www.dolibarr.org/forum/uploads/dolibarrorg/original/2X/9/9369a4503d51c9e6f74be112809f9bfea7740904.png)

I am happy with the results.

I guess this should be in the Wiki, but it is not, and I hope this may help somebody in the future.

Thanks a lot!

---

<div class="post-metadata">

**Author:** ![jonbendtsen](https://www.dolibarr.org/forum/letter_avatar_proxy/v4/letter/j/977dab/32.png) [@jonbendtsen](https://www.dolibarr.org/forum/u/jonbendtsen)\
**Post date:** [March 27, 2025, 9:39pm UTC](https://www.dolibarr.org/forum/t/solved-how-can-i-use-the-users-custom-fields-in-an-odt-document-template/30153/7 "2025-03-27T21:39:23Z")

</div>

> [@geppettvs](#):
>
> I guess this should be in the Wiki, but it is not, and I hope this may help somebody in the future.

GREAT you found a solution. Could we get you to make a step by step guide and post it in this thread such that others might find it?

---

<div class="post-metadata">

**Author:** ![geppettvs](https://www.dolibarr.org/forum/user_avatar/www.dolibarr.org/geppettvs/32/4029_2.png) [@geppettvs](https://www.dolibarr.org/forum/u/geppettvs)\
**Post date:** [March 27, 2025, 11:50pm UTC](https://www.dolibarr.org/forum/t/solved-how-can-i-use-the-users-custom-fields-in-an-odt-document-template/30153/8 "2025-03-27T23:50:27Z")

</div>

Hello my friend,

Sure! I can. Just allow some time and I will return with a useful handbook.

Thanks!

---

<div class="post-metadata">

**Author:** ![MikeSoft](https://www.dolibarr.org/forum/letter_avatar_proxy/v4/letter/m/9e8a1a/32.png) [@MikeSoft](https://www.dolibarr.org/forum/u/MikeSoft)\
**Post date:** [January 14, 2026, 12:08am UTC](https://www.dolibarr.org/forum/t/solved-how-can-i-use-the-users-custom-fields-in-an-odt-document-template/30153/9 "2026-01-14T00:08:18Z")

</div>

Hello, have you a useful handbook mentioned? I have problems with {mycompany\_managers}
