URI_TO_ASSET
Last updated
Was this helpful?
Last updated
Was this helpful?
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 representing a valid asset URI. It returns the associated with the given asset URI.
asset_uri (required, type: string) A string containing a valid asset URI.
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:
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.
For a deeper dive into the use cases of URI_TO_ASSET, check out or .