View Variable of a RITM in a simple list (Portal)

gml35
Tera Guru

Hi All,

I'm looking to give users a view of their past request of a particular item by creating a simple list on the portal and filtering by the item.   The issue I'm running into is that there is no way to pull the variables from the RITM.   Has anyone done this already?   I'd imagine it's a pretty common ask out there?

I appreciate any help you all can provide!!!

1 ACCEPTED SOLUTION

Chuck Tomasi
Tera Patron

Hi Glenn,



The first thing to note is that you will need a customer widget to do this. It's not available OOB because every RITM has different variables so there's no easy way to display them in a list.



If you choose to write a custom widget, you'll need to "load up" the data object for each record with the variables in the server script. Pretty straight forward when it comes to getting variables and values.



You can use this code in a mail script to print variables. This one assumes the message is on the sysapproval_approver table and gets the variables from the record pointed to by the sysapproval table. Below is a code snippet I use to get variable values for an approval record in to an email template. You can adjust the bold lines to your needs in the widget.




printVars();


function printVars(){


      var set = new GlideappVariablePoolQuestionSet();


      set.setRequestID(current.getValue('sysapproval'));


      set.load();


      var vs = set.getFlatQuestions();


      for (var i=0; i < vs.size(); i++) {


              if(vs.get(i).getLabel() != '') {


                      template.print('       ' +   vs.get(i).getLabel() + " = " + vs.get(i).getDisplayValue() + "\n");


              }


      }


}


View solution in original post

15 REPLIES 15

Hi,



So if i understood you correctly,



They want to see RITM's for particular catalog item which wer opened previously including Price and Vendors value.



And this should be just a table?



Thanks


Doesn't have to be a table just a way to view that data.


Igor Kozlov
Tera Expert

You can any variable in RITM list view. Here are steps you need:

1)Create a new view for RITM table and save it

2)Navigate to sys_ui_list_list.do and open a record for the view you have created

3)In the List Elements related list created a new record and set Element field to something like variables.fdd0eccc4fae62001fa791311310c7c7 (valiables.sys_id_of_the_variable in item_option_new table)

 

You can test the same approach with using variables.fdd0eccc4fae62001fa791311310c7c7 as a column name for Simple list

Thanks for the reply.  I ended up taking the simple list widget and configuring it to display my variables.

Amy Han1
Kilo Contributor

Hello, can you share the solution/code for this approach, please. I am needing the same exact requirement. Thanks.