Not able to assign object/integer from javascript to integer argument

Hi Team,
I want to return a integer from below Javascript , but AE is considering it as object. I tried to assign it to an object datatype argument and then convert it into integer but it is giving me error “not valid conversion”
Javscript is :
return
parseInt(document.querySelectorAll(":scope .form-horizontal .card .card-body .ng-star-inserted fieldset.ng-star-inserted div.ng-star-inserted fieldset").length - 1,10);

Tried using functions like convert.toInt32(to convert object to int) and cint(to convert string int) but its giving error.

Hi,

Using assign activity you can convert the string returned from JS block into integer separately

Regards,
Amit Anand

Tried using functions like convert.toInt32(to convert object to int) and cint(to convert string int) but its giving error.
Can tell me which funciton to use if my javascript is returning integer/number

Hi,

What is the error that you are getting. Share screenshot

Regards,
Amit Anand