Important! A new Community experience launched on September 26, 2017. Read more about it here or continue to Base Camp.
Vote up!
0 Votes
2 Replies

Question asked by Arjun Sharma on Feb 21, 2017 05:25 EST

I am trying to add a contact using for the first time but I am getting this error. var ob = {firstname:"John",phone:[{Mobile:["+919999999999"]}],postal:[{Work:[""]}]}; var res =; Error is: java.lang.NullPointerException: Attempt to invoke virtual method 'java.lang.String java.lang.String.intern()' on a null object reference, Name : Unknown Error, stack

Kony Answered Certificate
Vote up!
1 votes
Vote down!

Hi Arjun,

Can you please try the below code and check in your application.

var mycontact = { firstname : "John", lastname : "XYZ", phone : [{name:"mobile", number:"9999999999"}, {name:"home", number:"888888888"}], "email" : [{name:"work",id:""}], postal : [{name:"work",street:"ABC",city:"hyderabad",state:"AP",zipcode:"500084"}] }; var arrSting =;

We are suspecting that, in your code you are passing the work with null-value. All the contain details should be in the key:value format and we are expecting value should not be null.


Answered by: Feb 23, 2017 02:04 EST
Vote up!
0 votes
Vote down!

Worked. Thanks! The issue as I suspect was in the format of my table as I had even tried removing the work part and testing earlier. Even though it was explained in the documentation, I couldn't find any example on actual format. Please see below:

My table:

var myTable = { firstname : "John", phone : [ { Mobile : [ "+919999999999" ] } ] };


var myTable = { firstname : "John", phone : [ { name : "mobile", number : "9999999999"} ] };

Replied by: Feb 23, 2017 04:09 EST