{% assign track_record = entities['musdyn_track'][request.params.id] %} {% if track_record.musdyn_audiotrack_name %} <script> webapi.safeAjax({ type: "GET", url: "/_api/musdyn_tracks({{ request.params.id }})/musdyn_audiotrack", contentType:"application/json", success: function(res) { console.log(res); $('#main').append('<audio controls><source src="data:audio/mp3;base64,' + res.value + '" type="audio/mpeg">Your browser does not support the audio element.</audio>') }, error: function(xhr, status, error){ var errorMessage = xhr.status + ': ' + xhr.statusText; console.log(errorMessage); } }); </script> {% endif %}