#get the chosen id from the array
$execute store result score .selected relics_hub run data get storage relics_hub $(relic).list[$(id)]
$data modify storage relics_hub relics.reward set from storage relics_hub $(relic).reward[$(id)]

#remove it from storage
$data remove storage relics_hub $(relic).list[$(id)]