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
- 2K Product Ideas
- 2K Ideas Exchange
- 1.6K Connect
- 1.3K Connectors
- 311 Workbench
- 6 Cloud Amplifier
- 9 Federated
- 3.8K Transform
- 655 Datasets
- 114 SQL DataFlows
- 2.2K Magic ETL
- 811 Beast Mode
- 3.3K Visualize
- 2.5K Charting
- 80 App Studio
- 45 Variables
- 771 Automate
- 190 Apps
- 481 APIs & Domo Developer
- 77 Workflows
- 23 Code Engine
- 36 AI and Machine Learning
- 19 AI Chat
- AI Playground
- AI Projects and Models
- 17 Jupyter Workspaces
- 409 Distribute
- 120 Domo Everywhere
- 279 Scheduled Reports
- 10 Software Integrations
- 142 Manage
- 138 Governance & Security
- 8 Domo Community Gallery
- 48 Product Releases
- 12 Domo University
- 5.4K Community Forums
- 41 Getting Started
- 31 Community Member Introductions
- 114 Community Announcements
- 4.8K Archive