Getting error as "Could not serialize value" in flow designer

Rushi Savarkar
Kilo Sage

I have created a Subflow to fetch the Location data from the Workday endpoint, but it has a different structure for each record in XML. To resolve this issue , we have createda  custom script, so that it will take individual records and insert them into a staging table. 

To make the individual records, we have created actions in flow designer. Those actions are splitting the records and inserting them into the array.

The splitting works in the background script and even in the flow (checked for one record), but when we put XML that contains 102 records at that time, it is giving the Could not serialize value error. 

 

We found this link, but it is not helpful for us

https://support.servicenow.com/kb?id=kb_article_view&sysparm_article=KB0951861

 

We're stuck on this error. If anyone has expertise in this, please reply to this question.

Thank You!

 

If my response helped you, please accept the solution and mark it as helpful.
Thank You!
1 ACCEPTED SOLUTION

Shraddha Kadam
Mega Sage

Hello @Rushi Savarkar ,

 

Please use the .toString() method in the subflow where you get the data, and it will resolve your solution.

 

If my response was helpful, please mark it as correct and helpful.

 

Thank you

If my response was helpful, please mark it as correct and helpful.
Thank you.

View solution in original post

3 REPLIES 3

simonsparke
Tera Contributor

I have been dealing with a very similar issue..
A Workday rest call in a custom script in an action in flow designer, the script using restmessagev2 instead of a normal rest step

I realized the problem I had was that due to the size of the XML, I was hitting the string size limit when using ".getBody()" from the response, as this creates a string.

So I created a temporary object like this:
var tempObj = {"responseXML": response.getBody()};

Because objects can hold much larger data, which allowed me to parse the XML and not result in the error you are seeing

Hope this helps

Shraddha Kadam
Mega Sage

Hello @Rushi Savarkar ,

 

Please use the .toString() method in the subflow where you get the data, and it will resolve your solution.

 

If my response was helpful, please mark it as correct and helpful.

 

Thank you

If my response was helpful, please mark it as correct and helpful.
Thank you.

Shraddha Kadam
Mega Sage

Hello @Rushi Savarkar ,

 

If my response was helpful, please mark it as correct and helpful.

 

Thank you.

If my response was helpful, please mark it as correct and helpful.
Thank you.