Create fields with copied values

In cases where you want the values of a custom field to be carried forward to other entities within the same module, you can define the parameters as shown in this topic.

Use case

We will create fields for an existing field set under the risk scoring request entity. In this scenario, we want the values for this field to be copied from a field in another entity in the risk module.

Use case data
API parameter with values

The path parameter is the entity name for which you are creating the field (in this case, RISK.SCORING_REQUEST).

".../custom-fields/RISK.SCORING_REQUEST..."

In the body, we will enter a unique field ID, name, and data type. Also, we will specify the field set ID for which we are creating the field. Note: The data type must be the same as the field from which you want to copy values. The field ID and name can be different.

"fieldId": "internalCreditRating",
"name": "Measures probability of default according to internal credit rating model",
"fieldSetId": "CreditCheck",
"valueType": "TEXT"

We will also specify whether the field is unique, required, and active.

"unique": false,
"required": false,
"active": true

The entity name and field ID from which the values will be copied.

"copyFromEntityName": "RISK.SCORING_DECISION",

"copyFromFieldId": "internalCreditRating"

You can only copy values within the same module.

Sample API call

To create the field, use the following endpoint:

https://risk-api.sandbox.tuumplatform.com/api/v1/custom-fields/RISK.SCORING_REQUEST/field

Learn more about the create field endpoint in the Tuum developer portal.

Sample request

The sample request body is as follows:

{
  "fieldId": "internalCreditRating",
  "name": "Measures probability of default according to internal credit rating model",
  "fieldSetId": "CreditCheck",
  "valueType": "TEXT",
  "unique": false,
  "required": false,
  "active": true,
  "copyFromEntityName": "RISK.SCORING_DECISION",
  "copyFromFieldId": "internalCreditRating"
}

Sample response

Below you will find the response to the sample request:

Response
{
  "errors": null,
  "validationErrors": null,
  "data": {
    "fieldId": "internalCreditRating",
    "name": "Measures probability of default according to internal credit rating model",
    "fieldSetId": "CreditCheck",
    "entityName": "RISK.SCORING_REQUEST",
    "valueType": "TEXT",
    "unique": false,
    "required": false,
    "active": true,
    "copyFromEntityName": "RISK.SCORING_DECISION",
    "copyFromFieldId": "internalCreditRating",
    "activityCode": null,
    "lookupEntityName": null,
    "lookupTypeCode": null
  }
}

Result

We have created a custom field so that values that are entered for one entity will be copied to another.

Last updated

Was this helpful?