- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-29-2022 12:39 AM
Hi all,
I have a requirement where I have to get a Phone Number and, Alternative Phone 1, Alternative Phone 2 field values in Array. How can I define an array[] to get the values from consumer table.
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-29-2022 01:24 AM
Hi Siddharam,
You can use the following code to push the data in an array and I have also created one separate array so You can display the data easily.
var consumerData = new GlideRecord('csm_consumer');
consumerData.query();
consumerData.setLimit(5);
var consumers = [];
while(consumerData.next()){
var tempArray = []
tempArray.push(consumerData .getValue('number') + '');
tempArray.push(consumerData .getValue('mobile_phone') + '');
consumers.push(tempArray);
}
gs.info(consumers[0])
Kindly mark this as helpful.
Thank You,
Kunal
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-29-2022 01:12 AM
How do I push Phone Number and, Alternative Phone 1, Alternative Phone 2 field values in Array.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-29-2022 01:36 AM
kindly mark the answer as correct if it helped you.
Thanks
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-29-2022 01:24 AM
Hi Siddharam,
You can use the following code to push the data in an array and I have also created one separate array so You can display the data easily.
var consumerData = new GlideRecord('csm_consumer');
consumerData.query();
consumerData.setLimit(5);
var consumers = [];
while(consumerData.next()){
var tempArray = []
tempArray.push(consumerData .getValue('number') + '');
tempArray.push(consumerData .getValue('mobile_phone') + '');
consumers.push(tempArray);
}
gs.info(consumers[0])
Kindly mark this as helpful.
Thank You,
Kunal
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-29-2022 01:35 AM
Hi Kunal,
How can I assign the values stored in array to a choice field?