Add a field to a form from which contents come from a function
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-29-2023 08:24 AM - edited 11-29-2023 08:30 AM
Hello,
I have the need to add to a form a simple read-only textbox to display a string received from a function. I know about dictionaries function fields but that is not exactly what I need because they are bound to be used with "glidefunction:yyyy()" and I need more than that.
Here is the context: we have several customers from very different timezones and I want to show their actual time when the user access their account form. I have luxon imported as a UI Script and I can use it freely to convert between timezones. I just need a way to have a textbox (that is not a field on the database) to display this time
Like this mockup
Is it possible somehow?
Let me add that, for now, what I am doing is having a Dictionary Function Field with a script like
glidefunction:concat("", "")
which concats 2 empty strings and displays the empty textbox. On the page load, there is also a client script that then uses g_form.setValue to set the textbox to the time. This is clearly a very ugly workaround I would like to avoid.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-29-2023 09:56 AM - edited 11-29-2023 10:02 AM
Hi @mtrojahn ,
Can you try field message, display mesage right below the timezone field with the time using
g_form.showFieldMsg('field_value',dynamic time,'info');
ex:
Thank you,
Hemanth
Certified Technical Architect (CTA), ServiceNow MVP 2024, 2025

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-01-2023 02:59 AM
Hi @mtrojahn ,
did my response help? if so,
Thank you,
Hemanth
Certified Technical Architect (CTA), ServiceNow MVP 2024, 2025
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-01-2023 03:21 AM
It could be an option, but that is not what I am required to do. The users want that information to be shown as if it was a part of the form.