How to store data to different table

i have two page using gantt chart
first page i following from doc it’s work correctly store in task table

but second page i create new table when i create data will store at first table not store new table
i try to edit code
var dpa = new gantt.dataProcessor(“/api”);
but it’s not work

please help how to solve the problem.

Hello Ruengrid,
This should be configured on the server-side.
Here is the part of the code for the node.js where the server-side function loads the data from the tables:
https://docs.dhtmlx.com/gantt/desktop__howtostart_nodejs.html#:~:text=app.get("/data"%2C%20(req%2C%20res)%20%3D>%20{ %20%20%20%20%20%20%20%20Promise.all([ %20%20%20%20%20%20%20%20%20%20%20%20db.query("SELECT%20*%20FROM%20gantt_tasks")%2C %20%20%20%20%20%20%20%20%20%20%20%20db.query("SELECT%20*%20FROM%20gantt_links")

You need to specify different tables on the server side.

The easiest way for that would be to create different requests and responses for them.
In the second Gantt, you need to send a request to a different URL, then use a different table on the server-side.

For example:

    // server.js:
    app.get("/data", (req, res) => {
        Promise.all([
            db.query("SELECT * FROM gantt_tasks"),
            db.query("SELECT * FROM gantt_links")
        ]).then(results => {
            let tasks = results[0],
                links = results[1];
 
            for (let i = 0; i < tasks.length; i++) {
              tasks[i].start_date = tasks[i].start_date.format("YYYY-MM-DD hh:mm:ss");
              tasks[i].open = true;
            }
 
            res.send({
                data: tasks,
                collections: { links: links }
            });
 
        }).catch(error => {
            sendResponse(res, "error", null, error);
        });
    });

    app.get("/data2", (req, res) => {
        Promise.all([
            db.query("SELECT * FROM gantt_tasks2"),
            db.query("SELECT * FROM gantt_links2")
        ]).then(results => {
            let tasks = results[0],
                links = results[1];
 
            for (let i = 0; i < tasks.length; i++) {
              tasks[i].start_date = tasks[i].start_date.format("YYYY-MM-DD hh:mm:ss");
              tasks[i].open = true;
            }
 
            res.send({
                data: tasks,
                collections: { links: links }
            });
 
        }).catch(error => {
            sendResponse(res, "error", null, error);
        });
    });
//gantt1:
var dp = new gantt.dataProcessor(“/data”);

//gantt2:
var dp = new gantt.dataProcessor(“/data2”);