I am trying to determine how to create a popup Media Group of images from an Arcade array of image URLs. The images are not stored as attachments, but as a list of URLs in a field. I have been able to successfully parse the list and display the images using rich text with HTML tags, but I would prefer to have the look of a media group (i.e. with forward/backward arrows).
I know that JSON for a media group is generally of the following format:
{
"type": "media",
"description": "",
"mediaInfos": [
{
"altText": "",
"caption": "",
"title": "",
"type": "",
"value": {
"linkURL": "",
"sourceURL": ""
}
},
{
"altText": "",
"caption": "",
"title": "",
"type": "",
"value": {
"linkURL": "",
"sourceURL": ""
}
}.......]
}
Would the best approach be to simply build a JSON representation for the media group and then return the results of calling "FromJSON" on it? (https://developers.arcgis.com/arcade/function-reference/data_functions/#fromjson) Would that actually work to display a media group in the popup? Thanks in advance for any input or ideas.
Andrew