How will i get the row count of multi variable set using onsubmit catalog client script

ServicenowDev19
Tera Contributor

logivention_0-1679737517186.png

I have 2 feilds in multi row variable set.I want to fetch the row count of tat variable set on submit of the multi row variable and display the row **bleep** in alert.

please guide me for this.

1 件の受理された解決策

@ServicenowDev19 ,

 

You need to create this onsubmit client script on catalog item (Not on variable set client scripts) as mentioned below:

 

PRINCE_ARORA_0-1679757403973.png

 

元の投稿で解決策を見る

9件の返信9

hii,

I am trying this script on Onsubmit client script.

But giving me this error "JSON.parse: unexpected end of data at line 1 column 1 of the JSON data".

@ServicenowDev19 ,

 

Have you added any data in your variable set? if Not please add and then execute the script

I have tried this script in my PDI and this worked for me really well!

 

PRINCE_ARORA_0-1679754145637.png

 

 

Can you share the snippet of your code, if possible?

 

If my answer solved your issue, please mark my answer as Correct & 👍Helpful based on the Impact.



hii,

while adding records in multi row variable set it is giving me error.I am not able to add record in that variable set.

@ServicenowDev19 ,

 

You need to create this onsubmit client script on catalog item (Not on variable set client scripts) as mentioned below:

 

PRINCE_ARORA_0-1679757403973.png

 

Hii Prince,

I want to do this on Variable set client script but it is giving me error.

Your script is working for me on Catalog item client script.