--- title: "QQ - How do I dynamically create a banded field in script?" slug: "qq-how-do-i-dynamically-create-a-banded-field-in-script" updated: 2022-12-08T12:10:19Z published: 2022-12-08T12:10:19Z canonical: "docs.datajet.app/qq-how-do-i-dynamically-create-a-banded-field-in-script" --- > ## Documentation Index > Fetch the complete documentation index at: https://docs.datajet.app/llms.txt > Use this file to discover all available pages before exploring further. # QQ - How do I dynamically create a banded field in script? Banded fields group numeric data into "bins" that have specified upper and lower limits. Various options are available for controlling banding through the Banded Field dialog. To create the kind of banded field that will dynamically calculate bins depending on the source data, use the **Engineering | Banded Fields | Auto** option. This will bring up the Auto Banded Field dialog: ![](https://cdn.document360.io/73b6469b-c1e4-47e9-aa65-986c8ebd17ca/Images/Documentation/image-1670500866968.png) The following is an example of a JSON method used to create an Auto-banded field: ```json { "method": "BuildBakedField", "project": "DemoPrep6", "targetTable": "03_HEADER", "p1": "phone_no", "overwrite": true, "name": "phone_no_banded", "auto": true, "bands": 10, "named": true, "function": "numberband", "dataSet": { "logic": "or", "name": "state_AK", "strict": true, "set": [ { "logic": "and", "stype": "FIELD", "entity": { "type": "field", "name": "03_HEADER.state", "table": "03_HEADER", "valueFilter": [] }, "op": "=", "values": [ "AK" ] } ] } } ``` | Key | Value | Description | | --- | --- | --- | | method | BuildBakedField | | | project | | | | targettable | | table containing source field | | p1 | | field name | | overwrite | true, false | if true, field will be recreated | | name | | banded field name | | dataSet | | Filter of records to include in banding | | function | numberband | | | bands | 1...128 | number of "bins" or bands to create | | named | true, false | if true, band names will be automatically calculated | | auto | true, false | If true, band intervals will be automatically calculated to fit the specified number of bands |