Is there some easier way to get all the field names of a form.

jieLian123
Tera Expert

Is there some easier way to get all the field names of a form. I suppose to get all the field names

and do something common in a for loop.

6 REPLIES 6

Amit Verma
Kilo Patron
Kilo Patron

Hi @jieLian123 

 

Where you want to get the form variables ? If you need it in a flow, you can make use of Get Catalog Variables action.

 

Thanks & Regards

Amit Verma


Please mark this response as correct and helpful if it assisted you with your question.

I want to use the field names in a client script.

and do some action with g_form.

Hi @jieLian123 

 

Try as below :

var catalogFields = g_form.getFieldNames();

 

This will give you an array of field names. You can then iterate over them and do the respective actions.

 

Thanks & Regards

Amit Verma


Please mark this response as correct and helpful if it assisted you with your question.

Aniket Chavan
Tera Sage
Tera Sage

Hello @jieLian123,

For a more efficient approach, instead of the usual method of right-clicking on the form and configuring it to view all table fields,

AniketChavan_2-1706513530311.png

 

I recommend using the SN Utils Chrome extension. This extension not only simplifies the process but also offers additional benefits.

With SN Utils, you can quickly retrieve field names by double-clicking on an empty space within the form. This action will display both the backend name and the actual display name of the fields on the form itself. Moreover, to obtain a comprehensive list of all field names on the current form, you can utilize the extension by following these steps:

1. Click on the SN Utils extension.
2. A window will appear; navigate to the "GlideRecord" tab.
3. Here, you'll find all the current field values of the form conveniently listed in one place.
4. For a more detailed exploration, clicking on "Open in Background Script" under images will allow you to print all the field values of the current form.

This streamlined process not only enhances efficiency but also provides a user-friendly experience, making field name retrieval a breeze. If you haven't already, consider installing the SN Utils extension for a more convenient and effective workflow.

AniketChavan_3-1706513544412.png

AniketChavan_4-1706513639544.png

 

Let me know your views on this and Mark Correct if this solves your query and also mark 👍Helpful if you find my response worthy based on the impact.

 

Thanks,

Aniket