# How can I add a field here with a plugin?

**URL:** <https://forum.virtualmin.com/t/how-can-i-add-a-field-here-with-a-plugin/133546>\
**Category:** Developers\
**Created:** [May 26, 2025, 5:20pm UTC](https://forum.virtualmin.com/t/how-can-i-add-a-field-here-with-a-plugin/133546 "2025-05-26T17:20:45Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![ador](https://cdn.forum.virtualmin.com/user_avatar/forum.virtualmin.com/ador/32/20180_2.png) [@ador](https://forum.virtualmin.com/u/ador)\
**Post date:** [May 26, 2025, 5:20pm UTC](https://forum.virtualmin.com/t/how-can-i-add-a-field-here-with-a-plugin/133546/1 "2025-05-26T17:20:45Z")

</div>

Hello,  
I want to create an automation that runs when a virtual server is created, but for this, I need an input (string) from users. So I want to add the field on the virtual server creation page as the image. Can anyone help me, How can I do it? I can use the “post-modification” to run the automation, but how can I get the string from the users?  
Thank you.

 ![image](https://cdn.forum.virtualmin.com/uploads/default/original/3X/2/8/28e188997886854ecac002e64b196551ee0e2a15.png)

---

<div class="post-metadata">

**Author:** ![Joe](https://cdn.forum.virtualmin.com/user_avatar/forum.virtualmin.com/joe/32/9_2.png) [@Joe](https://forum.virtualmin.com/u/Joe)\
**Post date:** [May 26, 2025, 10:28pm UTC](https://forum.virtualmin.com/t/how-can-i-add-a-field-here-with-a-plugin/133546/2 "2025-05-26T22:28:06Z")

</div>

If I understand what you’re asking, you can use `$VIRTUALSERVER_FIELD_fieldname` in your scripts, as documented here: [Template Variables | Virtualmin — Open Source Web Hosting Control Panel](https://www.virtualmin.com/docs/development/template-variables/#domain-template-variables)

---

<div class="post-metadata">

**Author:** ![ador](https://cdn.forum.virtualmin.com/user_avatar/forum.virtualmin.com/ador/32/20180_2.png) [@ador](https://forum.virtualmin.com/u/ador)\
**Post date:** [May 27, 2025, 6:22am UTC](https://forum.virtualmin.com/t/how-can-i-add-a-field-here-with-a-plugin/133546/3 "2025-05-27T06:22:46Z")

</div>

Hello Joe,  
Thank you for your response. But this is how I can get the custom fields values which I created from System customization \>\> Custom Fields.  
But my question is may I create a field like this with a plugin and how?  
Thank you.

---

<div class="post-metadata">

**Author:** ![Joe](https://cdn.forum.virtualmin.com/user_avatar/forum.virtualmin.com/joe/32/9_2.png) [@Joe](https://forum.virtualmin.com/u/Joe)\
**Post date:** [May 27, 2025, 7:08am UTC](https://forum.virtualmin.com/t/how-can-i-add-a-field-here-with-a-plugin/133546/4 "2025-05-27T07:08:05Z")

</div>

Ah, ok…hmm… I’m pretty sure that’s possible, as I think the nginx plugin sets some variables, but maybe it’s just the same data that is available from core when using Apache. Have you looked at any of our plugins for clues? Almost all Virtualmin plugins are open source in our GitHub.

Looks like maybe the `envs_to_set` hash is for this purpose?

> <https://github.com/virtualmin/virtualmin-nginx/blob/785fb16d416124e647feec0a63f37eab84af1eb3/virtualmin-nginx-lib.pl#L1670>

---

<div class="post-metadata">

**Author:** ![system](https://cdn.forum.virtualmin.com/uploads/default/original/2X/c/cd96d761e326db4b2bef94886a639109bd7a8e76.svg) [@system](https://forum.virtualmin.com/u/system)\
**Post date:** [September 24, 2025, 7:08am UTC](https://forum.virtualmin.com/t/how-can-i-add-a-field-here-with-a-plugin/133546/5 "2025-09-24T07:08:17Z")

</div>

Closed on September 24, 2025, 7:08am UTC

This topic was automatically closed 120 days after the last reply. New replies are no longer allowed.
