Hi Folks
I understand that %asset_assetid^as_asset:asset_name% returns the name but, if I have the asset as a string id how would I achieve the same
For example what I am trying to achieve
“Parent name - Child name”
Below is the code I am using to try this
|||
SCRIPT
const assets = %asset_metadata_psccapabilities^json_decode^as_asset:asset_name,asset_url,asset_assetid,asset_parent%;
Short but incomplete answer - %globals_asset_name:12345%
It looks like that JS is running in the browser, at which point it’s too late to fetch any fresh data that isn’t already available to your JS in assets.
I think you’d need to move the html generation code to SSJS, which would allow you to follow the process:
Get data from %asset_metadata... keyword (including the ID of each parent)
run SSJS over that data and spit out html which contains %globals_... keywords
Those globals keywords get processed before the html is sent to the browser.