Fetch node property value of asset whose Properties page is open | Community
Skip to main content
Level 6
February 19, 2021
Solved

Fetch node property value of asset whose Properties page is open

  • February 19, 2021
  • 1 reply
  • 1397 views

I have added a new dropdown to the asset Properties page. I have also added a custom validation file to the asset metadata schema. When I select any asset and open the Properties page, the JS file loads. 

I wanted to verify the value of some node properties-value (like title, mime type etc) of the asset whose Properties page is open. But i dnt know how can i get the resource and its property values.

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.
Best answer by Anudeep_Garnepudi

@shaheena_sheikh 

You can do an AJAX call from your custom JavaScript to get the asset Node values. Try the below code.

 

let props = $.getJSON($("form[data-formid]").data("formid")+".infinity.json"); // To get metadanode values let props = $.getJSON($("form[data-formid]").data("formid")+"/_jcr_content/metadata.json"); // Get specific property value let mimeType = props.responseJSON["dam:MIMEtype"];

 

 Hope this works.

1 reply

Anudeep_Garnepudi
Community Advisor
Anudeep_GarnepudiCommunity AdvisorAccepted solution
Community Advisor
February 22, 2021

@shaheena_sheikh 

You can do an AJAX call from your custom JavaScript to get the asset Node values. Try the below code.

 

let props = $.getJSON($("form[data-formid]").data("formid")+".infinity.json"); // To get metadanode values let props = $.getJSON($("form[data-formid]").data("formid")+"/_jcr_content/metadata.json"); // Get specific property value let mimeType = props.responseJSON["dam:MIMEtype"];

 

 Hope this works.

Level 6
February 22, 2021
Can you please provide some link which I can use to explore further more on this one?