string and long... inserting xml data into number fields

string and long... inserting xml data into number fields

I absolutely love your getURL and XPath builder features. I use them frequently in my apps. However, I am running into a large hurdle that is holding me back from finishing a couple projects.

I insert my xml data into form fields on validate and a few of the insertion form fields are supposed to be number (LONG) and my xml string is well, string! So even though the my xml path "/result/rows/text()"); is only one node of text and it's always a number, it won't recognize it as one.

I have found a small work around. I can save my script with these fields as "single line" and then after saving the script go back and change the insertion fields to "number".

It actually does work! However, it creates some hassles later when trying to edit scripts or publish. It's pretty much a hack I think.

I use the following code snippet taken from your "get data" app example (Great example btw):



mapvar = getUrl("http://hidden.xml?dm_rep_number=" + input.Rep_Number + "&password=" + input.Password,false);
stringdata = mapvar.get("responseText");
xmldata = stringdata.toXML();
strdata = xmldata.executeXPath("/result/rows/text()");
input.rep_rows = strdata;
insert into change
[
Added_User = zoho.loginuser
row_number = input.rep_rows
]












As they say in Zoho land, KINDLY help me figure out how to format these fields so that I can use these numbers. Thank you!

Ammendment!

Just solved my own problem. for anyone that has the same problem just convert string to long using the built in toLong() function.