--- title: "Fields from Values" slug: "create-fields-from-values" updated: 2023-10-26T13:47:32Z published: 2023-10-26T13:47:32Z canonical: "docs.datajet.app/create-fields-from-values" --- > ## 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. # Fields from Values ## Overview Create multiple flag fields from multiple discrete values of a given field.![](https://cdn.document360.io/73b6469b-c1e4-47e9-aa65-986c8ebd17ca/Images/Documentation/image-1645144629973.png) ## Setup - Select source table then field - Or drop a field onto the fields combo - Or drop a field onto the grid The grid will fill with the unique values of that field. Unwanted values can be deleted by selecting them and hitting Delete Value or Right->Click->Delete Selected. The grid will fill with a suggested name for each field, based on the unique value. This can be edited. Optionally, a universal filter can be applied. Select a target table for the flag fields, this can be left empty if same as the source field's table. The new fields will be created on both tables if **Add To Both Tables** is checked ## Tips: For discrete fields, when only a small percentage of values are required, drag and drop a field on the empty grid, this will invoke the value selector tool: ![](https://cdn.document360.io/73b6469b-c1e4-47e9-aa65-986c8ebd17ca/Images/Documentation/image-1645144878993.png) This gives control over the values initially added to the grid. The same field can be dragged onto the grid again to append further values if required. Cardinality and field selector displayThe discrete value selector will only display if: - field is a string with less than 250 discrete values - field is a numeric with less than 50 discrete values ## External Editing Use the grid's context menu to copy data for pasting into an external editor. Once edited the results can be pasted back by right clicking on the grid and selecting **Paste New Definition.** ![](https://cdn.document360.io/73b6469b-c1e4-47e9-aa65-986c8ebd17ca/Images/Documentation/image-1645145152152.png) #### Creating fields from values ![](https://cdn.document360.io/73b6469b-c1e4-47e9-aa65-986c8ebd17ca/Images/Documentation/image-1698324654774.png)Create new Dataset fields from Field Values #### Creating datasets from values ![](https://cdn.document360.io/73b6469b-c1e4-47e9-aa65-986c8ebd17ca/Images/Documentation/image-1698324830406.png)Create as datasets #### Example JSON The following JSON creates new dataset fields from selected field values ```json { "method": "FieldsFromValues", "overwrite": true, "bothTables": false, "asDataSets": false, "field": "worldcities.capital", "values": [ "null", "admin", "minor", "primary" ], "names": [ "capital_null", "capital_admin", "capital_minor", "capital_primary" ], "project": "BikeData3" } ```