Join the #BuildWithBuildAgent Challenge! Get recognized, earn exclusive swag, and inspire the ServiceNow Community with what you can build using Build Agent.  Join the Challenge.

Please help with Multirow variable set populate values

Lisa Goldman
Kilo Sage

Hello, 

I have been struggling to figure out how to link the two tables and get the data populated.  I hope someone can help. 

 

I would like to populate variables in a Multirow variable set based on the selection of the part number variable.  If a part number is selected, then populate the part description, Qty and Price variables  

 

LisaGoldman_0-1709070760982.png

 

Table: u_part_number

Columns: part_id   (Primary Key)

                 part_no

 

Table: u_part_detail

 Columns:  part_id (Primary Ke)

                   part_description

                   qty

                   price

 

Muti Row Variables:  Part No (Reference field)

                                    Part Description (Single text)

                                    Qty (dropdown)

                                    Price (dropdown)

6 REPLIES 6

AshishKM
Kilo Patron
Kilo Patron

Hi @Lisa Goldman , 

 

Create MRV ->Part No ( variable = part_no ) reference to table u_part_number

 

For Part Description (Single text) reference to table u_part_detail with reference qual

javascript: 'part_no=' + current.variables.part_no'

AshishKMishra_0-1709073274626.png

 

Check with this update and confirm if its working for, assuming variable name as part_no , in both table and MRV. You can change as per configuration.

 

-Thanks,

AshishKM


Please mark this response as correct and helpful if it helps you can mark more that one reply as accepted solution

Thank you for helping @AshishKM 

I have been trying to get it work, but still no luck.  The reason why it did not work is because the variable contains sys_id instead of the actual value.  Is it possible to convert it to display value.

 

LisaGoldman_0-1709093030968.png

 

Hi @Lisa Goldman 

 

Can you try updating the reference qualifier as below :

 

javascript:'u_part_id='+current.variables.part_id.getDisplayValue();

 

Thanks & Regards

Amit Verma


Please mark this response as correct and helpful if it assisted you with your question.

Hello @Amit Verma 

I made the changes based on your suggestion.  It is now displaying the actual value in the lookup box.  However, the value did not get refresh when I select difference part no.  Could you provide suggestion.  Thank you