The CreatorCon Call for Content is officially open! Get started here.

how to count all services in Dynamic CI group and populate in custom field.

Kranthi Kumar4
Tera Expert

Hi 

 I have created CI count field in Dynamic CI group form" cmdb_ci_query_based_service".

 I need to count all "view service CI" and populate in "CI count" field.

Issue: when i click the "view service CI" Ui action . it opens the view link from their i need to copy the count.

KranthiKumar4_0-1689837403225.pngKranthiKumar4_1-1689837497717.png

How to get the count from 2nd image highlighted link.

 

Best regards,

Kranthi.

4 REPLIES 4

Sohail Khilji
Kilo Patron

Dear Kumar,

 

May I know where you going to use the Dynamic CI Group count in? 

 

For this you need to use Either GlideRecord or GlideAggregate to get the total number of Dynamic CIs in group using getRowCount().

 


☑️ Please mark responses as HELPFUL or ACCEPT SOLUTION to assist future users in finding the right solution....

LinkedIn - Lets Connect

Hi 

For example , I have added count field in dynamic group form ok . I want to get count from  "view services CI". View services CI is UI action it is referring to view. I want that count. 

script: 

action.setRedirectURL('/$sa_qbs_view.do?sysparm_plugin_mode=assurance'+
                                  '&sysparam_back_ref=quary_based_assurance_table'+
                                  '&sysparm_bsid=' + current.sys_id+'&sysparm_bsname=' + current.name);

Hi Kumar ! 

 

it's not clear what you have shared, can you please be clear what is needed ?

 

As per my understanding I see you have added a field which says 'count', which should get updated when the Ui action is clicked ''view services CI''. To do so you can override the UI action script to update the record count in the count field using getRowCount();

 

 

 

 


☑️ Please mark responses as HELPFUL or ACCEPT SOLUTION to assist future users in finding the right solution....

LinkedIn - Lets Connect