Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

Abstract

This code snippet retains the only value of a multi-valued type field which can either be an array of objects or a set of values. This snippet is useful when you know that the array has only one value and hence by applying the first or last methods you can retain it. 

Logic

Use the first/last filter to get the only object of the field and access the specific field for the required value.

...

Filter by label (Content by label)
showLabelsfalse
max5
spacesKB
showSpacefalse
sortmodified
reversetrue
typepage
cqllabel = "jmwe-nunjucksgroovy" and type = "page" and space = "KBJMWE"
labelsjmwe-nunjucks jmwe-cloud

...