Print query results to field
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-11-2017 01:55 PM
So, I am looking to get a list of all CI's associated to a user and print it into a task field. Maybe the Description field, Maybe Work Notes. I have not decided.
What would be the easiest way to do that? The goal is to provide a list of machines without making the person go hunt through a related list. I could print out the task and tell a person to go forth and conquer.
- Labels:
-
Scripting and Coding

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-11-2017 02:05 PM
You can create UI page and populate table in this UI page to display asset assigned to current users.
You can open UI page with UI macro and refer UI macro in field.
OR
you can create client script and do Glideajax to populate description with asset assigned to current user.
Regards,
Sachin
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-11-2017 02:15 PM
To be more clear, here is what I am doing. In the workflow, I say via a query, - Does the person have any computers associated to him? If yes, create a task to retrieve them (This is part of our "exit" workflow) What I then want to do is to populate a field on the task that lists out the computers. Possibly getting more clever and only showing active ones.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-11-2017 02:20 PM
Are you creating task using run script activity in workflow?
if yes, you can populate description of task with computer assigned to users in run script.
Also, you can define new run script activity to populate description after task is created by workflow.
Regards,
Sachin
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-11-2017 02:07 PM
you could just make a relationship and show it on tasks... that way its always there and never have to actually print it to a field... not sure your exact requirements but this would be my approach.
Creating Defined Related Lists - ServiceNow Wiki