Chandra Bergmann Chandra Bergmann

The function URI_TO_ASSET takes an asset URI in the form of a string and returns the Asset. 

This function takes as input a string representing a valid asset URI. It returns the Asset associated with the given asset URI. 


URI_TO_ASSET(asset_uri) -> asset



asset_uri (required, type: string)
A string containing a valid asset URI.

Return Values

asset (type: Asset)
The Asset that the given asset URI points to. If it cannot parse the URI, it throws an error.


Assume we know there is an asset associated with the asset URI "asset://global:15a00ea3-6980-48ea-8e8c-651ddff1f0bf:f1919287-7659-459e-a975-4d057762cc17:46dc543e-e960-4d38-8dd0-ec51dfdd19d1:0". The following example returns the Asset associated with the asset URI:

URI_TO_ASSET("asset://global:15a00ea3-6980-48ea-8e8c-651ddff1f0bf:f1919287-7659-459e-a975-4d057762cc17:46dc543e-e960-4d38-8dd0-ec51dfdd19d1:0") -> {
"organizationId": "15a00ea3-6980-48ea-8e8c-651ddff1f0bf",
"assetKey": "f1919287-7659-459e-a975-4d057762cc17",
"id": "46dc543e-e960-4d38-8dd0-ec51dfdd19d1",
"version": 0,
"visibility": "GLOBAL"

The following example attempts to find the Asset that associated with the URI "This is a string". "This is a string" is not a valid URI, and so URI_TO_ASSET throws an error. 

URI_TO_ASSET("This is a string") -> ERROR


For a deeper dive into the use cases of URI_TO_ASSET, check out The Fetch Asset Details Data Operation or Working with existing PDFs.


Was this article helpful?

0 out of 0 found this helpful

Articles in this section