Skip to main content
Solved

Create record from the Multiselect Lookup

  • September 22, 2022
  • 2 replies
  • 25 views

Forum|alt.badge.img+18

Previously I’m using multiselect field from the current table. However, I am trying to automate by pulling the multiselect field from the LOOKUP. But when I want to run the script, I am unable to do so.

Here is the structure of the base

My current script

let templateName = r.getCellValue(s.tempField.name);
console.log(templateName)

let monthName = r.getCellValue(s.monthField.name);


templateName.forEach(item => console.log(`${monthName}; ${item.name}`));

let combinedArray = templateName.map(item => `${monthName}; ${item.name}`);

console.log(combinedArray);
output.table(combinedArray);

How to modify this script? Thanks!

Best answer by Alexey_Gusev

Hi,
try to add .join().split(',')
right after getCellValue(fname)
i’m not sure it’s correct for all types of lookup, but it should work in your case

note that if your values contain comma, you should define another divider, also providing join() with it

2 replies

Alexey_Gusev
Forum|alt.badge.img+25
  • Brainy
  • 1261 replies
  • Answer
  • September 22, 2022

Hi,
try to add .join().split(',')
right after getCellValue(fname)
i’m not sure it’s correct for all types of lookup, but it should work in your case

note that if your values contain comma, you should define another divider, also providing join() with it


Forum|alt.badge.img+18
  • Author
  • Inspiring
  • 118 replies
  • September 22, 2022

Hi,
try to add .join().split(',')
right after getCellValue(fname)
i’m not sure it’s correct for all types of lookup, but it should work in your case

note that if your values contain comma, you should define another divider, also providing join() with it


You’re a lifesaver! Thanks a lot mate!