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.

Flow Designer

Sayali_9822
Tera Contributor

Hi Team,

 

I created one subflow where I am getting this error 'Error: Cannot find function push in object' How can we resolve this?

attached screenshot of this error.

 

Thanks in advance!!!

1 ACCEPTED SOLUTION

Yes, it was as I expected. You have declared the variable as a String, not an array.

Also, you're missing a semicolon after the variable declaration.

Replace it with this:

var outputString = [];

 

And then when assigning the contents of the variable, you convert it from array to string like this:

outputs.journal = outputString.join(',');

 

View solution in original post

4 REPLIES 4

OlaN
Tera Sage
Tera Sage

Hi,

Screen shot is missing.

 

Anyhow, first guess. You have some inline scripting that tries to add data to an non-array object.

Sayali_9822
Tera Contributor

please see attachment

Yes, it was as I expected. You have declared the variable as a String, not an array.

Also, you're missing a semicolon after the variable declaration.

Replace it with this:

var outputString = [];

 

And then when assigning the contents of the variable, you convert it from array to string like this:

outputs.journal = outputString.join(',');

 

Sayali_9822
Tera Contributor

Thank you so much, resolved my error!!!