Fetch node property value of asset whose Properties page is open

Avatar

Avatar
Applaud 25
Level 2
Shaheena_Sheikh
Level 2

Likes

2 likes

Total Posts

97 posts

Correct reply

1 solution
Top badges earned
Applaud 25
Applaud 5
Affirm 1
Validate 10
Validate 1
View profile

Avatar
Applaud 25
Level 2
Shaheena_Sheikh
Level 2

Likes

2 likes

Total Posts

97 posts

Correct reply

1 solution
Top badges earned
Applaud 25
Applaud 5
Affirm 1
Validate 10
Validate 1
View profile
Shaheena_Sheikh
Level 2

19-02-2021

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.

Accepted Solutions (1)

Accepted Solutions (1)

Avatar

Avatar
Establish
MVP
Anudeep_Garnepudi
MVP

Likes

275 likes

Total Posts

320 posts

Correct reply

87 solutions
Top badges earned
Establish
Ignite 1
Give Back 5
Give Back 3
Give Back 10
View profile

Avatar
Establish
MVP
Anudeep_Garnepudi
MVP

Likes

275 likes

Total Posts

320 posts

Correct reply

87 solutions
Top badges earned
Establish
Ignite 1
Give Back 5
Give Back 3
Give Back 10
View profile
Anudeep_Garnepudi
MVP

21-02-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.

Answers (0)