How To Select a Value for Lookup Select Box in Flow Designer

fabdinov
Tera Contributor

I have a form that contains a Lookup Select Box type question. The form needs to be submitted for every room record in cmn_location table. I can select a data pill for line text questions, but not for lookup select box.

fabdinov_0-1745346231291.png

I want the select box to be set to Location Record > Name, however lookup select box doesn't seem to support record data pills. For reference, here is the question's specifications:

fabdinov_1-1745346347279.png

So the value I want is included in the lookup of the select box, but I can't find a way to select it.

 

 

1 ACCEPTED SOLUTION

I have an action I built (which I probably found somewhere, but I don't remember where, so I can't give credit) to update a catalog variable on a RITM. You can create this action and run it after submitting the new RITM and pass it that RITM and the value you want to set. Here are the details of that action:

 

JenniferRah_0-1745581892361.pngJenniferRah_1-1745581938370.png

This is the script from the script step:

(function execute(inputs, outputs) {
  
try { 
    var variables = inputs.requested_item.variables.getElements(); 
    
    for (var i = 0; i < variables.length; i++) { 
      var question = variables[i].getQuestion(); 
      
      if (question.getName() == inputs.variable_name) {
        question.setValue(inputs.variable_value);
      }  
    }

    inputs.requested_item.update();
    
    outputs.state = 'success';
  }
  catch (e) {
    gs.error(e);
    
    outputs.state = 'error';
  }
})(inputs, outputs);

 

 This is the output from the script step:

JenniferRah_2-1745582013191.png

Then I set the overall state to the state from the script step.

JenniferRah_3-1745582054563.png

 

View solution in original post

9 REPLIES 9

JenniferRah
Mega Sage

For some strange reason, it looks like Lookup Select Boxes are not supported for this function. See https://support.servicenow.com/kb?id=kb_article_view&sysparm_article=KB0962980 

Ankur Bawiskar
Tera Patron
Tera Patron

@fabdinov 

yes it's not supported

Lookup select box variable is read-only in flow SC core action, Submit Catalog Item Request 

You can update that variable, check the workaround here, enhance for Lookup select box variable

Workaround for limitation with action in flow designer 'Submit catalog Item Request' (list collector... 

If my response helped please mark it correct and close the thread so that it benefits future readers.

Regards,
Ankur
✨ Certified Technical Architect  ||  ✨ 9x ServiceNow MVP  ||  ✨ ServiceNow Community Leader

Thanks! However, the sciprt would copy vars from one RITM to another. What I need is to take values from the current iteration in for each and add them to the form. Is there a workaround specifically for that?

@fabdinov 

create a flow variable and set it when you iterate and then use that to update the RITM generated by Submit Catalog Item Action

Then just before the loop ends, set the flow variable to empty again so that it gets set with the next iteration and can be reused again.

I hope I have answered your question.

If my response helped please mark it correct and close the thread so that it benefits future readers.

Regards,
Ankur
✨ Certified Technical Architect  ||  ✨ 9x ServiceNow MVP  ||  ✨ ServiceNow Community Leader