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.5K Connect
- 1.2K Connectors
- 300 Workbench
- 6 Cloud Amplifier
- 9 Federated
- 2.9K Transform
- 100 SQL DataFlows
- 620 Datasets
- 2.2K Magic ETL
- 3.9K Visualize
- 2.5K Charting
- 742 Beast Mode
- 58 App Studio
- 41 Variables
- 686 Automate
- 176 Apps
- 453 APIs & Domo Developer
- 47 Workflows
- 10 DomoAI
- 36 Predict
- 15 Jupyter Workspaces
- 21 R & Python Tiles
- 395 Distribute
- 113 Domo Everywhere
- 276 Scheduled Reports
- 6 Software Integrations
- 124 Manage
- 121 Governance & Security
- 8 Domo Community Gallery
- 38 Product Releases
- 10 Domo University
- 5.4K Community Forums
- 40 Getting Started
- 30 Community Member Introductions
- 108 Community Announcements
- 4.8K Archive