# Validate Data for Table Example

> Demonstrates data validation against database tables using API Maker system APIs.

Source: https://docs.apimaker.dev/v1/examples/sys/system/isValidDataForTable.html

<!-- --8<-- [start:body] -->

`g.sys.system.isValidDataForTable` calls the [is valid data for table system API](/v1/docs/apis-all/system-apis/system-generated-is-valid-data-for-table-api.html) from your code, whatever the settings of that API say about HTTP callers.

### Validate table data

Test data valid or not using global object 'g'.

```ts linenums="1"
await g.sys.system.isValidDataForTable({
    instance: "INSTANCE_NAME", database: 'DB_NAME', collection: "COLLECTION_NAME",
    data: {
        "field": "fieldValue",
        "field": "fieldValue"
    }
});
```

```ts linenums="1"
await g.sys.system.isValidDataForTable({
    instance: "mongoDB",
    database: "db_inventory",
    collection: "tbl_customers",
    data: {
        "customer_id": 1,
        "first_name": "Bob",
        "last_name": "Lin",
        "last_update": "2006-02-14T23:04:33.000Z",
        "pincode": 382330,
        "isActive": 1
    }
});
```

<!-- --8<-- [end:body] -->

## Related

- [Is valid data for table system API](/v1/docs/apis-all/system-apis/system-generated-is-valid-data-for-table-api.html) · [All system APIs from code](/v1/examples/sys/system/system.html) · [The global object g](/v1/docs/pre-defined-terms/global-object-g.html)
