Variable Editor

jonathan_77
Mega Expert

Help, please.   I am trying to understand how to use/work with formatters.   A process is already in place (possibly OOB) through our Service Catalog for requesting Access to specific applications.   Once the user submits the access request and their manager approves it, a Task is generated for our Access team to provide them with the necessary permissions.   On the Task generated for access, it contains information in something called a Variable Editor (Formatter).   I've done research and I understand that a formatter is a form element used to display information that is not a field in the record.   I've had to create a process, for a user, that sends two Tasks to different groups when a specific access is requested.   My issue is I cannot figure out how to get the Variable Editor (Formatter) information to show on the additional Task that I have created?? Any thoughts on how to accomplish adding this info?

1 ACCEPTED SOLUTION

HI Jonathan,



Yes, you should be able to set the variables in the business rule in the same way. The task is a GlideRecord object and the source (request item?, you didn't say) is also a GlideRecord. Here's a snippet of how you would do such a thing.



task.variables.variable_name = ritm.variables.variable_name;


View solution in original post

10 REPLIES 10

jonathan_77
Mega Expert

Hi Chuck,



Thank you so much for your help!   Yes, the source is the RITM(request Item) and the name of the variable set is Service Catalog Common.     The variable created in my BRule to query the Task table is grTask.   So from what you have suggested above would I use something like this:



grTask.variables.Service Catalog Common = ritm.variables.Service Catalog Common;



Sorry, I am just so confused with these Variable Sets/Formatters.


hi Jonathan,



Thanks for the info. You cannot copy an entire variable set at once with script. You need to the variables individually by name. For example:



grTask.variables.user_id = ritm.variables.user_id;


grTask.variables.due_date = ritm.variables.due_date;


// copy the remaining variables one-by-one


Kalaiarasan Pus
Giga Sage

Not sure if this is what you are looking. I just wrote a blog about it.


Unlearn Series - Missing Catalog Task Variables


jonathan_77
Mega Expert

Chuck,



Thank you again for all your help.   I wasn't able to get the entire Variable Set to copy over on the second/additional Task but I was able to pull the individual values out of the Variable Set and add them into the Description of the new Task.   This is a huge step in the right direction and I think it will be sufficient for what I am attempting to build.   Thank you so much!!



Thanks,


Jonathan


jonathan_77
Mega Expert

Kalaiarasan,



Thank you for the information that you have provided.   I think your blog is on track for what I am trying to accomplish.   I only need the second task to be created if the user requests access to one specific application that I will call XYZ.   If the user requests access to XYZ, the Task that is created by our defualt request item workflow will be created and it will display the Variable Set questions and values that were entered on the Access form in the Service Catalog.   I will then also need to create the ad-hoc Task at this point.   Would I need to use some kind of condition on the BRule you have discussed in your blog to only create a Task if access is requested for XYZ?  



Thanks,


Jonathan