Pulling data from another table based on condition

I’m trying to do something like:
I searched the data I wrote in TABLE2 Column2 in TABLE1 Column2,
It will write the value in Column3 corresponding to the value in TABLE1 Column2 to TABLE2 Column3.
I wrote the following code for this, but without success. Is there anyone who can help?

let resultTest= await doo.table.getData('Urunler', 
																{filter: [	
																		{field: "model", operator: "in",  CPU Seri },
																], filterOperator: "and"}
                                                       );

console.log( resultTest[1]);

I am aware that the code I wrote is inexperienced. Unfortunately, there are not many resources and examples on the internet for the tabidoo platform. If that were the case it would be a really useful platform.

Note: The picture is given as an example. To facilitate the explanation.

Hello,
Loading data is described in

In your case I would use something like:

let options = {
    filter: "model(in)(CPU Seri)"
} as IDooGetDataOption<IDooApiTableANY>;
let resultTest= await doo.table.getData<IDooApiTableANY>('Urunler', options);
console.log(resultTest);

Of course you can play with filters, specify your table instead of IDooApiTableANY etc…
Regards
Michal

Thank you for your support. But unfortunately that’s not what I was trying to do.
I want to search the value in Table2 T2Column1 in Table1 Column1 and print the value in Table1 Column2 to Table2 T2GetDataColumn2.
I tried to explain more clearly and descriptively with the pictures I added. I hope it works…

Table1
Table2

Code

Hi,
Please, contact us at support@tabidoo.cloud, so we can communicate that more.
It would be probably the best if you share the application to the email (support…) and we can create the script.
Regards
Michal

    const options = {
        filter: `column1(eq)${doo.model.t2Column1.value}`
    };
    // load data from Table1
    let dataT1 = await doo.table.getData<IDooApiTableTable1>("Table1", options);
    
    if (dataT1.data.length === 1) {
        const sourceRow = dataT1.data[0];
        const column2Value = sourceRow.fields.column2;
        //update table1
        await doo.table.updateFields('Table2', doo.model.id, { t2GetDataColumn2: column2Value });
    } else {
        doo.alert.showInfo(`Record with ${doo.model.t2Column1.value} not found or more than one found.`)
    }
1 Like

Thank you for helping. It turns out we have to manually push the button to pull the data. There is no way I can automatically pull data by typing js code into the calculated field.
When I enter the code you gave into the “calculated field”, the code gives an error and does not work. I am also attaching the screenshot.

This is too complicated for a calculated field.
Please use the workflow I created for you. And change the trigger from Button to After Change.
(it would be better to send me these thinks to email. This FAQ is turning into chat :slight_smile: )
Michal