Expand my Community achievements bar.

Learn about Edge Delivery Services in upcoming GEM session
SOLVED

How can i iterate through the values from page.getProperties() in groovy?

Avatar

Level 6

How can i iterate through the values from page.getProperties() in groovy?

1 Accepted Solution

Avatar

Correct answer by
Community Advisor

Hi @Shaheena_Sheikh,

getProperties method returns ValueMap , you can iterate like this:

 

page?.getProperties()?.each { property ->
    println "Property key: ${property?.key}"
    println "Property value: ${property?.value}"
}

 

key represents property key, value represents property value.

View solution in original post

1 Reply

Avatar

Correct answer by
Community Advisor

Hi @Shaheena_Sheikh,

getProperties method returns ValueMap , you can iterate like this:

 

page?.getProperties()?.each { property ->
    println "Property key: ${property?.key}"
    println "Property value: ${property?.value}"
}

 

key represents property key, value represents property value.