URI_TO_ASSET
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.
Declaration
Parameters
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.
Examples
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.
Discussion
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.
Last updated