31 lines
1.1 KiB
TypeScript
31 lines
1.1 KiB
TypeScript
import { flow, Message, Custom, Credential } from '@robomotion/sdk';
|
|
|
|
flow.create('75ef5a17-4961-44b3-bb2b-406cc34b7ba5', 'SeaTable List Rows', (f) => {
|
|
f.addDependency('Robomotion.SeaTable', '1.0.4');
|
|
|
|
f.node('a1b2c3', 'Core.Trigger.Inject', 'Start', {})
|
|
.then('d4e5f6', 'Robomotion.SeaTable.Connect', 'Connect SeaTable', {
|
|
optCredentials: Credential({
|
|
vaultId: 'be60cc83-6cd1-453c-a50b-498c58e4fc26',
|
|
itemId: '82d20666-415d-4510-83ab-3437021da70c',
|
|
}),
|
|
outClientID: Message('client_id'),
|
|
})
|
|
.then('76ca4a', 'Robomotion.SeaTable.Rows.List', 'List Rows', {
|
|
inClientID: Message('client_id'),
|
|
inTableName: Custom('Table1'),
|
|
outRows: Message('rows'),
|
|
outCount: Message('count'),
|
|
})
|
|
.then('cfdcea', 'Core.Programming.Function', 'Format Data', {
|
|
outputs: 1,
|
|
func: `var data = JSON.stringify(msg.rows, null, 2);
|
|
var header = "SeaTable rows (" + msg.count + "):";
|
|
msg.log_text = header + data;
|
|
return msg;`,
|
|
})
|
|
.then('5484c4', 'Core.Flow.Log', 'Log Rows', {
|
|
inText: Message('log_text'),
|
|
});
|
|
}).start();
|