- 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:39 AM
You can achieve that by using GlideAjax in the client script.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-29-2022 01:44 AM
If you can provide me script it would be helpful for me. Thanks