The Random/getAccountReferenceNumber extension is intended to request account data from a fixed endpoint and extract the AccountReferenceNumber field from the JSON response.
This is useful when a journey needs to work with an account reference number generated by a supporting test service or environment-specific endpoint before continuing with downstream validation.
Parameters:
- No input parameter is required. The endpoint URL is hardcoded in the source code.
Note: This extension does not accept a URL or account identifier as an input. It always uses the fixed endpoint written in the source code, so the endpoint must be reachable from the browser context where the journey step runs.
How to apply this to your journey
Use the extension in a journey by calling Random/getAccountReferenceNumber with the execute command. This extension has no direct inputs.
Note: The source code uses fetch(), but the extension is configured as synchronous because Run asynchronously was provided as No. As written, the fetch callback may run after the extension step has already finished, and the source does not call getARN() or return the fetched value from the top-level script.
execute "Random/getAccountReferenceNumber" returning $responseexecute "Random/getAccountReferenceNumber" returning $accountReferenceNumberBecause the endpoint is hardcoded, no variable setup is required for the extension inputs. A journey can still store or assert the returned value if the source is updated to return the fetched ARN correctly.
execute "Random/getAccountReferenceNumber" returning $accountReferenceNumberExample output when the implementation returns the account reference number successfully:
ARN123456789This extension does not require any external resource.
The extension should be configured as:
- Run asynchronously: No
- Scope: Global
Limitation: This source uses fetch() and nested .then() handlers, but it is configured as synchronous and does not call done() or doneError(). It also defines getARN() without invoking it, so the top-level script does not currently return the fetched AccountReferenceNumber. If the function is called later, the return arn inside the nested callback returns only from that callback, not from the language-extension step. The hardcoded service URL must be reachable from the selected execution environment and can be affected by CORS, certificates, DNS, VPN, proxy, firewall, or environment routing. Because this is a network-based browser request, behavior can differ between Virtuoso's default Chromium-based browser and cross-browser or remote-grid executions, especially when the target browser handles certificates, mixed network access, or cross-origin requests differently. Validate the endpoint access and returned value in each browser/device configuration used by the plan.
Add the extension to your Virtuoso instance
Select the domain that matches your Virtuoso account.
View source
Last updated: 04/06/2026
Resources:
This extension does not require any external resource.
var arn;
function getARN() { fetch('https://lhr-web-prod-01:8443/CCM.VirtuosoNet/single')
.then(
function(response) {
response.json().then(function(data) {
arn = data.AccountReferenceNumber;
return arn;
});
}
)
}
Comments
0 comments
Please sign in to leave a comment.