Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion components/salesforce_rest_api/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@pipedream/salesforce_rest_api",
"version": "1.3.0",
"version": "1.3.1",
"description": "Pipedream Salesforce (REST API) Components",
"main": "salesforce_rest_api.app.mjs",
"keywords": [
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,21 @@ export default {
name: "New Record (Instant, of Selectable Type)",
key: "salesforce_rest_api-new-record-instant",
description: "Emit new event when a record of the selected object type is created. [See the documentation](https://sforce.co/3yPSJZy)",
version: "0.1.0",
version: "0.2.0",
props: {
...common.props,
fieldsToObtain: {
propDefinition: [
common.props.salesforce,
"fieldsToObtain",
(c) => ({
objType: c.objectType,
}),
],
optional: true,
description: "Select the field(s) to be retrieved for the records. Only applicable if the source is running on a timer. If running on a webhook, or if not specified, all fields will be retrieved.",
},
},
hooks: {
...common.hooks,
async deploy() {
Expand Down Expand Up @@ -40,7 +54,7 @@ export default {
Id: id,
} = item;
const entityType = startCase(objectType);
const summary = `New ${entityType} created: ${name}`;
const summary = `New ${entityType} created: ${name ?? id}`;
const ts = Date.parse(createdDate);
return {
id,
Expand All @@ -57,7 +71,7 @@ export default {
[nameField]: name,
} = newObject;
const entityType = startCase(this.objectType).toLowerCase();
const summary = `New ${entityType} created: ${name}`;
const summary = `New ${entityType} created: ${name ?? id}`;
const ts = Date.parse(createdDate);
return {
id,
Expand Down Expand Up @@ -118,8 +132,11 @@ export default {
setObjectTypeColumns,
} = this;

const { fields } = await getObjectTypeDescription(objectType);
const columns = fields.map(({ name }) => name);
let columns = this.fieldsToObtain;
if (!columns?.length) {
const { fields } = await getObjectTypeDescription(objectType);
columns = fields.map(({ name }) => name);
}

setObjectTypeColumns(columns);
},
Expand Down
Loading