We've Moved! Please visit our new and improved forum over at our new portal: https://portal.plumvoice.com/hc/en-us/community/topics

Error reading XML file

Questions and answers about IVR programming for Plum DEV

Moderators: admin, support

Post Reply
vikas
Posts: 53
Joined: Wed May 13, 2015 7:46 pm

Error reading XML file

Post by vikas »

Hi Plum

I am getting below error when reading an XML file in our Preprod environment.
Code is saved as "SafewayAutomation" in scratchpad. It is assigned to 855-606-3493.

I have verified the Javascript code in other editors and cannot find a reason why I am getting this error in Plum Voice.
TypeError: records has no properties

support
Posts: 3632
Joined: Mon Jun 02, 2003 3:47 pm
Location: Boston, MA
Contact:

Re: Error reading XML file

Post by support »

Hi Vikas,

It appears as though you are receiving this error because the JavaScript DOM version supported in our hosting site does not support the square bracket notation for iterating through objects. Instead, you should use the item() method. We were able to return "yahoo" by changing the following in your scratchpad:

Code: Select all

for (i = 0; i < records.length; i++) {
	if (records.item(i).childNodes.item(0).toString() === ani) {
			return ('yahoo');
	}
}
Note that we also added the toString() method since you are using the === operator for comparison, which does not perform type conversions. Since the item() method returns an object, but the ani variable in your code is a string, this comparison would evaluate to false without the toString() method, even if the two numbers were identical.

Regards,
Plum Support

vikas
Posts: 53
Joined: Wed May 13, 2015 7:46 pm

Re: Error reading XML file

Post by vikas »

Thanks a lot. That worked

Post Reply