Create a offline form to add questions from existing Questionnarie template
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-10-2025 03:18 AM
Hi Folks,
I am trying to create a offline form by clicking on a UI Action, new offline form should open with questionnaire template from assessment metric table. User can able to answer these questions.
some one can help me with this--Thanks!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-10-2025 03:26 AM
1. Create Custom Tables
A. u_offline_questionnaire
(Parent record)
-
Fields:
-
Requested By
(reference tosys_user
) -
Created Date
-
Status
(e.g., Draft, Submitted)
-
B. u_offline_question
(Child record)
-
Fields:
-
Questionnaire
(reference tou_offline_questionnaire
) -
Metric
(reference toasmt_metric
) -
Question Text
-
Answer
(string, choice, or reference based on metric type)
-
Link via one-to-many relationship between
u_offline_questionnaire
andu_offline_question
.
Create a UI Action Server Side Code :-
// UI Action on a record or menu // Create new questionnaire var questionnaire = new GlideRecord('u_offline_questionnaire'); questionnaire.initialize(); questionnaire.requested_by = gs.getUserID(); questionnaire.status = 'draft'; questionnaire.insert(); // Fetch metrics from template var metrics = new GlideRecord('asmt_metric'); metrics.addQuery('metric_type', 'questionnaire'); metrics.query(); while (metrics.next()) { var question = new GlideRecord('u_offline_question'); question.initialize(); question.questionnaire = questionnaire.sys_id; question.metric = metrics.sys_id; question.question_text = metrics.getValue('question'); question.insert(); } action.setRedirectURL(questionnaire);
3. Design the Questionnaire Form
-
On the
u_offline_questionnaire
form:-
Add a related list or embedded list for
u_offline_question
-
Allow users to edit the
Answer
field for each question
-
Pls mark my solution as accept and thumbs up if you find it helpful. It will help other users on community to find helpful response.
Regards,
Samaksh Wani
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-10-2025 05:53 AM
offline form has to load existing questionnaire template questions to answer directly. when click on the ui action