Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
ā11-13-2024 09:06 AM
Hello all,
The API response body return:
{
"iban":"GB33BUKB20201555555555",
"country_code":"GB",
"checksum":"33",
"bank_id":"BUKB",
"branch_id":"202015",
"account_number":"55555555",
"length":22
}
How can I extract only the branch ID and account number from the catalog client script?
function onChange(control, oldValue, newValue, isLoading) {
if (isLoading || newValue == '') {
return;
}
var iban = g_form.getValue('iban');
var gaFields = new GlideAjax('SwiftValidation');
gaFields.addParam('sysparm_name', 'getIBAN');
gaFields.addParam('sysparm_iban', iban);
gaFields.getXML(showSWIFTData);
function showSWIFTData(response) {
var answer = response.responseXML.documentElement.getAttribute("answer");
//alert('the IBAN details: ' + answer );
var obj = JSON.parse(answer);
for (var i = 0; i < obj.length; i++) {
alert('The extraction: '+obj[i].account_number ++obj[i].branch_id );
}
}
}
Solved! Go to Solution.
1 ACCEPTED SOLUTION

Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
ā11-13-2024 09:14 AM
If you only want the account_number and branch_id, you would just use
obj.account_number
obj.branch_id
for your alert, that would look like this
alert('The extraction: ' + obj.account_number + ' ' + obj.branch_id );
If this information helped resolve your issue, please remember to mark response correct and thumbs up to help future community members on this information, thanks!
1 REPLY 1

Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
ā11-13-2024 09:14 AM
If you only want the account_number and branch_id, you would just use
obj.account_number
obj.branch_id
for your alert, that would look like this
alert('The extraction: ' + obj.account_number + ' ' + obj.branch_id );
If this information helped resolve your issue, please remember to mark response correct and thumbs up to help future community members on this information, thanks!