Contact Us

If you still have questions or prefer to get help directly from an agent, please submit a request.
We’ll get back to you as soon as possible.

Please fill out the contact form below and we will reply as soon as possible.

  1. Fotoware Alto
    • 11.14 Schreckhorn
    • Terminology
    • Solutions
    • User Guide - Deutsch
    • User Guide - English
    • API Changelog
  2. Fotoware Veloz
    • Managing users and groups
    • Configuring archives
    • Configuring workflows
    • Configuring site behavior
    • Navigating and searching to find your assets
    • Working with your assets
    • Editing asset metadata
    • Uploading files
    • Version Control in Fotoware
    • Albums - Creating and sharing collections
    • Placing assets in a CMS
    • Working with the Fotoware Pro interface
    • Using the Fotoware plugins
    • Consent management
    • User guide to FotoWeb for iPad (Legacy)
    • Picture conferencing with FotoWeb Screens (Legacy)
    • What's what in Fotoware
    • GDPR
    • Fotoware Veloz releases
    • Activity Exports
    • Fotoware Example Workflows
  3. Fotostation
    • Getting started with Fotostation
    • Viewing, selecting and sorting files
    • Managing your assets with archives
    • Adding metadata to assets
    • Searching for assets
    • Working with your assets
    • Version Control in Fotostation
    • Automating tasks with Actions
    • Configuring metadata fields and editors
    • Configuring Fotostation
    • Configuring Fotostation for multi-user environments
    • Troubleshooting Fotostation
  4. Fotoware Flow
    • What is Flow?
    • Getting started
    • Flow dictionary
  5. Fotoware On-Premises
    • Getting started
    • Index Manager
    • FotoWeb
    • Color Factory
    • Connect
    • Operations Center Guide
  6. Integrations and APIs
    • The Fotoware API
    • Creating integrations using embeddable widgets
    • Authorizing applications using OAuth
    • Auto-tagging
    • FotoWeb Drag and Drop export
    • Integration using webhooks
    • Optimizely and Episerver plugin documentation
    • User Interface Integrations
  7. Fotoware Mobile
    • User guide for Fotoware Mobile for iPhone and Android
    • User guide to FotoWeb for iPad (Legacy)
    • User guide to FotoWeb for iPhone and Android (Legacy)

Contact Us

If you still have questions or prefer to get help directly from an agent, please submit a request.
We’ll get back to you as soon as possible.

Please fill out the contact form below and we will reply as soon as possible.

  • Support

Table of Contents

Data Model Business Rule JSON Trigger Condition Transformation Action Initiate the fieldset Assign the tag to the tagbox in the fieldset
  • Home
  • Fotoware Alto
  • Solutions

Business Rule: File Name Parsing to Fieldsets

11. March 2025

Elaine Foley

Table of Contents

Data Model Business Rule JSON Trigger Condition Transformation Action Initiate the fieldset Assign the tag to the tagbox in the fieldset

To categorize our content we can select to update product, event or corporate information. Lets focus on managing product information in Picturepark. Some content is about products. Some content is only about the product line, the industry, or the end-use sector. All files contain either the product name or just the industry or the end-use-sector.

Data Model

The layer prioritizes the product name - as this is the main type of content. Still, other product details are available as part of a fieldset.

LAYER "Product"
Tagbox "Product name"
Single Fieldset "Product details"
 Tagbox "Product Line"
 Tagbox "Industry"
 Tagbox "End-use sector"
 Tagbox "Various product tags"

Business Rule JSON

JSON for Business Rule

{
   "kind": "BusinessRuleConfigurable",
   "condition": {
       "kind": "OrCondition",
       "conditions": [
           {
               "kind": "AndCondition",
               "conditions": [
                   {
                       "kind": "ContentSchemaCondition",
                       "schemaId": "ImageMetadata",
                       "traceRefId": null
                   },
                   {
                       "kind": "MatchRegexCondition",
                       "fieldPath": "imageMetadata.fileName",
                       "regex": "(?:csm[ _])?(?:bobst[ _])?(?<product>\\w+)",
                       "storeIn": "parsed_eus",
                       "traceRefId": null
                   }
               ],
               "traceRefId": null
           }
       ],
       "traceRefId": null
   },
   "transformationGroups": [
       {
           "inputs": [
               "$parsed_eus$"
           ],
           "transformations": [
               {
                   "kind": "TakeDictionaryValueTransformation",
                   "key": "product",
                   "traceRefId": null
               },
               {
                   "kind": "SplitTransformation",
                   "separators": "_",
                   "keepEmpty": false,
                   "trim": false,
                   "traceRefId": null
               },
               {
                   "kind": "JoinByTransformation",
                   "separator": " ",
                   "traceRefId": null
               },
               {
                   "kind": "LookupCacheTransformation",
                   "namedCache": "EndUseSectors",
                   "traceRefId": null
               }
           ],
           "storeIn": "eusRefId",
           "traceRefId": null
       }
   ],
   "actions": [
       {
           "kind": "AssignLayerAction",
           "layerId": "Product",
           "defaultValues": {
               "productDetails": {}
           },
           "traceRefId": null
       },
       {
           "kind": "AssignTagboxItemsAction",
           "path": "product.productDetails",
           "fieldId": "endUseSectors",
           "refIds": "$eusRefId$",
           "replace": false,
           "traceRefId": null
       }
   ],
   "id": "filenameParsingForEUS",
   "triggerPoint": {
       "executionScope": "MainDoc",
       "documentType": "Content",
       "action": "Create"
   },
   "isEnabled": true,
   "names": {
       "en": "Filename parsing for end-use sectors"
   },
   "description": {
       "en": ""
   },
   "enableTracing": true
}
 
 

Trigger

On creation of new Content Items.

"triggerPoint": {
       "executionScope": "MainDoc",
       "documentType": "Content",
       "action": "Create"
   },

Condition

Check for images and extract information from the filename using regex.

Regex in use: https://regexr.com/5f202

Optimization: use split (_), join (“ “), and ngram (size 1 - max words (4)) instead of regex for this kind of filenames.

"conditions": [
                    {
                        "kind": "ContentSchemaCondition",
                        "schemaId": "ImageMetadata",
                        "traceRefId": null
                    },
                    {
                        "kind": "MatchRegexCondition",
                        "fieldPath": "imageMetadata.fileName",
                        "regex": "(?:csm[ _])?(?:bobst[ _])?(?<product>\\w+)",
                        "storeIn": "parsed_eus",
                        "traceRefId": null
                    }
                ],

Transformation

Lookup the product value from the filename regex, split the values separated by underline into single words, then join them with space. Then lookup the new value in the product cache.

Example file name

Filename: csm_compa_Beverages_Beer_Wine_Spirit.jpg

Regex:

  • removes csm (case insensitive)
  • removes compa (case insensitive)
  • keep the rest in the variable “product”
  • Outcome: Beverages_Beer_Wine_Spirit

Transformation:

  • Split values separated by underline = [Beverages, Beer, Wine, Spirit]
  • Join them with space: Beverages Beer Wine Spirit

Now go find “Beverages Beer Wine Spirit” in the end-use sectors and return the ID for the industry tag.

 
 

The tagbox value “Beverages Beer Wine Spirit” must match the lookup. It must be an exact match.

Beverages Beer Wine Spirit = Beverages Beer Wine Spirit

Beverages Beer Wine Spirit != Beverages, Beer & Wine & Spirit

As a workaround, I use a non-indexed, non-searchable text field that holds the exact matching value. 

 

Action

Now assign the Layer “Product” and initiate the single fieldset (aka “press add” to add a new fieldset entry). Then assign the industry tag to the tagbox “industry” in the fieldset.

Don’t use Assign Value Action for tagboxes, as this may result in a metadata validation error when the tag id cannot be assigned. Technical: assign value action will try to assign [null] to the tagbox which invalidates the metadata, which results in metadata errors along the way.

 

Initiate the fieldset

Assign the tag to the tagbox in the fieldset

"actions": [
        {
            "kind": "AssignLayerAction",
            "layerId": "Product",
            "defaultValues": {
                "productDetails": {}
            },
            "traceRefId": null
        },
        {
            "kind": "AssignTagboxItemsAction",
            "path": "product.productDetails",
            "fieldId": "endUseSectors",
            "refIds": "$eusRefId$",
            "replace": false,
            "traceRefId": null
        }
    ],
fieldsets name parsing

Was this article helpful?

Yes
No
Give feedback about this article

Related Articles

  • Changing a site's default page title
  • Selecting assets
  • How to find and use taxonomy items quickly
  • Filter Query: Parent Filter
eco-lighthouse-miljøfyrtårn

Company

  • About us
  • Resellers
  • Careers
  • Contact us

Help & support

  • Support center
  • Consultancy
  • Tech partners
  • Fotostation
  • System status

Trust Center

  • Legal
  • Security
  • Sustainability & ESG

Locations

Fotoware AS (HQ)
Tollbugata 35
0157 OSLO
Norway
FotoWare Switzerland AG
Industriestrasse 25
5033 Buchs (AG)
Switzerland

Copyright 2025 Fotoware All rights reserved.

  • Terms of service
  • Privacy policy
  • Cookie policy

Knowledge Base Software powered by Helpjuice

Expand