- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-15-2024 09:17 AM
Hi.
I have a flow with an action to create an HR task and send that HR task to someone to be visible in the portal. The objective is for the user to access the portal and send some variables with information. Some of these variables must already be populated and read-only, so this user cannot change these variables.
The task is created, associated to a hr case and it will appear on the portal for the user.
Now, the problem is that on the portal, the autopopulated variables (first screen shoot) are not appearing with the values
But if we look into the backend...
...the variables are populated with the information provided on the flow.
How can I show also the variables populated on the portal?
Thank you
André Ramos
Solved! Go to Solution.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-15-2024 09:32 AM
@Andr_1 Usually the variable and their values are stored in question_answer table for record producers, you need to write an onLoad client script and a script include to make a query to this table via a GlideAjax call. Once the values are received in the call back, you can set the field values using g_form.setValue() method.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-15-2024 09:32 AM
@Andr_1 Usually the variable and their values are stored in question_answer table for record producers, you need to write an onLoad client script and a script include to make a query to this table via a GlideAjax call. Once the values are received in the call back, you can set the field values using g_form.setValue() method.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-15-2024 09:35 AM
thank you for your response.
How can I do it? To make the query on the question_answer table, I need to know the hr task sys_id... How can I get this sys id on the onload script?
Can you give me a short example please?

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-15-2024 10:03 AM
@Andr_1 I create an article around this here to get the HR task sys_id https://www.servicenow.com/community/hrsd-articles/fetching-subject-person-details-on-a-record-produ.... You can follow the steps mentioned in this article to get the sys_id of the current hr task.
Hope this helps.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-16-2024 01:30 AM
Thank you for your help
Your article looks nice... but I don't need this complexity
I found a better way to get the sys_id via URL through catalog client scripts