MockHero

constant

Logic

Output the same fixed value for every record. Useful for setting a default status, source field, or any column that should have identical values across all rows.

Example Outputs

active1.0truedefault

Parameters

ParameterDescription
valueThe constant value to output (any type)

API Usage

Send a POST request to generate constant data:

curl -X POST https://mockhero.dev/api/v1/generate \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
  "tables": [
    {
      "name": "example",
      "count": 5,
      "fields": [
        {
          "name": "constant",
          "type": "constant",
          "params": {
            "value": "active"
          }
        }
      ]
    }
  ]
}'

Common Use Cases

  • Default status fields
  • Fixed source columns
  • Batch markers
  • Static configuration values

Quick Info

Field Type
constant
Category
Logic
Parameters
1 parameter
Output Format
JSON, CSV, SQL

Try it now

Generate constant data instantly in the playground.

Related Types

Generate Constant + 155 more types via API

One API call. Multiple tables. Relational integrity. Free tier included.

Get Started Free