Not able to append the dataset in Workflow
I was able to pass the value, my workflow is showing status as completed. But not able to see the new records in the dataset. I have created my own code engine. Below mentioned is the link. Using version. 1.0.2.
https://bareinternational.domo.com/codeengine/761fcf57-8592-45c6-9f37-1adf5b795473
Answers
-
Pravin, nobody can see your codeEngine package without having access to your Domo instance.
You can paste your code here and I'd be happy to take a look. Is there a reason you're not using the existing Domo published function for appending a row to a dataset?0 -
Actually I am trying to upload multiple rows in the dataset through WF. I am not able to configure current code engine due its output format. Here you go with my code. Kindly note that, just now I observed that, its not accepting the special characters while saving to the target dataset via this code. So it would be good, if you help me in that case.
const codeengine = require('codeengine');const DATASOURCE = {
v2: 'api/data/v2/datasources',
v3: 'api/data/v3/datasources',
};
const DATASET_URL =${DATASOURCE.v3}/:id
;
const UPLOADS_URL =${DATASET_URL}/uploads
;
const UPLOADS_PARTS_URL =${UPLOADS_URL}/:uploadId/parts/1
;
const UPLOADS_COMMIT_URL =${UPLOADS_URL}/:uploadId/commit
;async function appendToDataset(dataset, values) {
const uploadsUrl = UPLOADS_URL.replace(':id', dataset);
const uploadsBody = {
action: 'APPEND',
message: 'Uploading',
appendId: 'latest',
};try {
const uploadsResponse = await codeengine.sendRequest(
'post',
uploadsUrl,
uploadsBody,
);
const partsUrl = UPLOADS_PARTS_URL.replace(':id', dataset).replace(
':uploadId',
uploadsResponse.uploadId,
);await codeengine.sendRequest('put', partsUrl, values, null, 'text/plain'); const commitUrl = UPLOADS_COMMIT_URL.replace(':id', dataset).replace( ':uploadId', uploadsResponse.uploadId, ); const commitBody = { index: true, appendId: 'latest', message: 'it worked', }; return await codeengine.sendRequest( 'put', commitUrl, commitBody, null, 'application/json', );
} catch (error) {
console.error(error);
}
}0
Categories
- All Categories
- 1.8K Product Ideas
- 1.8K Ideas Exchange
- 1.6K Connect
- 1.2K Connectors
- 300 Workbench
- 6 Cloud Amplifier
- 9 Federated
- 2.9K Transform
- 102 SQL DataFlows
- 626 Datasets
- 2.2K Magic ETL
- 3.9K Visualize
- 2.5K Charting
- 754 Beast Mode
- 61 App Studio
- 41 Variables
- 693 Automate
- 178 Apps
- 456 APIs & Domo Developer
- 49 Workflows
- 10 DomoAI
- 38 Predict
- 16 Jupyter Workspaces
- 22 R & Python Tiles
- 398 Distribute
- 115 Domo Everywhere
- 276 Scheduled Reports
- 7 Software Integrations
- 130 Manage
- 127 Governance & Security
- 8 Domo Community Gallery
- 38 Product Releases
- 11 Domo University
- 5.4K Community Forums
- 40 Getting Started
- 30 Community Member Introductions
- 110 Community Announcements
- 4.8K Archive