How to derive a field value from other two fields?

Suppose I have a content model name: Banners.
It has following three fields:

  1. route,
  2. position,
  3. derivedBannerPositionByRoute (unique).

When creating content, i want the derivedBannerPositionByRoute to be readonly and auto update based on what user enters in route and position.

For ex. if user enter “home” in route and position as “1”, the automatically locked derivedBannerPositionByRoute should have “home_1”.

Is there a way I can achieve this in contentful?

This is a classic use case for the App Framework, and I’ve actually built something similar. At a high level, you would build a field-level app using create-contentful-app, then have that app look at the two fields and concatenate their values into the third field.

The App Framework is all React-based, so it should be relatively simple to make it reactive and update as the source fields are updated as well :sunglasses: If you’re new to the App Framework, this is a great video to get you started: How to extend Contentful's interface with custom fields - YouTube