How to check the node property type is single value or multi value in aem? | AEM Community Blog Seeding | Community
Skip to main content
kautuk_sahni
Community Manager
Community Manager
May 17, 2022

How to check the node property type is single value or multi value in aem? | AEM Community Blog Seeding

  • May 17, 2022
  • 0 replies
  • 1071 views

BlogImage.jpg

How to check the node property type is single value or multi value in aem? by Rashid Jorvee

Abstract

How to check the node property type is single value or multi value in aem?
We can check the type of property(whether single or multiple) using the method isMultiple() of Property interface. Below is an example to check the node property "items" is a single value or multiple values and based on that get the value or values for that property in AEM.



Property property = node.getProperty("items");
Value[] values = null;
if(property.isMultiple()){
values = property.getValues();
} else {
values[0] = property.getValue();
}



Hope this helps. Thank you!

Read Full Blog

How to check the node property type is single value or multi value in aem?

Q&A

Please use this thread to ask the related questions.

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