Auto-populate fields with values (concat) from other properties?

Hi everyone :slight_smile:

Is it possible to auto-populate eg “dcterms:title” by concatenating values from other properties?

For example, if I have an Item of class “Event”, with the following properties:

  1. dcterms:type (Text)
  2. dcterms:date (Numeric: Date interval)

Could I do something like this?
dcterms:title = printf('%s - (%s)', dcterms:type, dcterms:date)?

Thank you very much in advance!

I wanted to do the exact same thing, but couldn’t find anything to do it. We’ve hacked it in for now using our own custom module that listens to the api.hydrate.post event (it also does a lot of other data prep and population, so was needed anyway).

In theory, it wouldn’t be too hard to build a generic module that takes some kind of expression to evaluate and populate on hydrate.

My colleage found out, that you can use the AdvancedResourceTemplate Module.

It provides a field called automatic value (on save), which allows to query existing property values.

Works.
Partially:

The following query draws partial ‘blanks’, even though I’ve checked on the API page of that item, that the values I’m querying exist and have a value:

({dcterms:identifier.0.@value}) {dcterms:format.0.@value} - “{rdae:P20001.0.display_title}” ({schema:brand.0.display_title})

It seems like some properties can be queried, while others cannot. :frowning_face:

Is there anything distinguishing any properties from others?
Could this be a missing index-or-related-table issue?

I’m grateful for any insights!
I really find this a great feature.
Especially for “event”, or other film-cataloging type of metadata: Great for auto-generating an “identifying title”. /if/ we could access all the fields equally.

I’m zuversichtlich.

Additional info:

This value is perfectly accessible, as well as most dcterms fields:

rdae:P200001.0.value_resource_id

It seems so arbitrary which are accessible and which ones aren’t. Curious to find out! :slight_smile:

Anyone else using the AdvancedResourceTemplateModule - or auto-populating fields in another way?