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.

Display all the assets assigned to User

Community Alums
Not applicable

Hi Experts,

We have a requirement, it is to Display all the assets assigned to Affected user in a catalog itemAffected user is a reference variable pointing to (sys_user table).

If user has one asset it should display as below image (1)

Sagar12_0-1666688500291.png

If the affected user has multiple devices it should display as below image (2)

Sagar12_1-1666689557444.png

Note:  Assets should be displayed from cmdb_ci_computer table.

11 REPLIES 11

@Sagar Garige @Community Alums  If my response is helpful, You can mark it as correct and close the question loop. It would help future readers as well.

@Community Alums @Sagar Garige Any update on this?

Hi Sai Kumar,

I have tried your code but it is working partially.
eg: In our PDI Beth Anglin has three assets assigned to her but it displays only one among them.

SagarGarige_0-1666702117982.pngSagarGarige_1-1666702239411.png

What we can do to display all the three assets at a time?
Thanks in advance,

Hello @Sai Kumar B 

Your reply is Highly Appreciated.

Thanks in advance,

I too have the same issue with this code.

It only retrieves the first record found not all CIs.

There is also a missing syntax in the client script that I needed to add.

@Sai Kumar B - Are you able to review this code?