- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-29-2024 10:59 AM
Evening all
Was hoping someone may have an answer for this issue I'm facing.
I have a cat item with a MRVS. What I'm trying to do is pass the results of each row on the variable set (1st cell) into a catalogue task short description which I'm doing within flow designer.
I'm using the for each (see screen shots) as this is working fine for all the variables other than one.
I had to use an inline edit on the short description of the task to retrieve the cell value I'm trying to work with (script below) which retrieves the correct cell value I want. That being the work_instructions which is the name of my variable set and the script is retrieving the correct cell value I need.
------------
This issue is that if there is 2 rows see the below, its combing both the cell values into 1 and because im using a for each its putting them into the same short description if that makes sense.
These are the rows-
This is the output in the short description on both tasks.
Im trying to put row1 into its own catalog task so should be the value 'REL and TST' into task 1
Then trying to put the row2 into its own catalog task should be the the value 'TST, MST' in this example.
Any suggestions would be appreciated.
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-30-2024 08:41 PM
Hi @CandyDee,
I think you would have to iterate the referenced table to get the display value of the records, i.e.
var ra2 = fd_data._2__for_each.item.ra2;
var downtime = fd_data._3__look_up_record.record.value;
var install = fd_data._2__for_each.item.downtime_window;
var shortDescription = [];
var refRecord = new GlideRecord('tableName'); //Enter the table name of the referenced table
refRecord.addEncodedQuery('sys_idIN' + fd_data._2__for_each.item.list_variable_name);//replace 'list_variable_name' with the list variable name
refRecord.query();
while(refRecord.next())
{
shortDescription.push(refRecord.getDisplayValue());
}
var fullShortDescription = "Install " + ra2 + " " + shortDescription.join(',') + " on " + install + " during " + downtime;
return fullShortDescription;
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-30-2024 11:39 PM
Master Chun
A hat tip and salute to your skill and generosity of time in helping me get this working. I really appreciate it, I doubt I would of figured out that line change. Thank you so much and it works.
Have a great easter dude.