Hi,
So I have been Bothering Jon for a bit in direct messages. I thought I would post it here so I don’t have to bother Jon with it all the time.
I am trying to have a clean bit of code. I have actually been messing around for a while and now doing a complete rework of the node I am developing. Was getting too complicated with al the work arrounds I was trying to do.
I want to keep it simple now. For each resource their are some operations to perform. They are not all the same and have a lot of differences and similarities. Rather than to create a list of options separate for every resource I would like to use the display options to filter what is possible for that resource.
I cannot get this to work. Below is my Resource and operation property. Jon gave me the tip to use " ‘/Resource’ " instead of " resource " as this is used in the wait node. But apparently I am doing something wrong, because I cannot get this to work here.
{
displayName: 'Resource',
name: 'resource',
type: 'options',
options: [
{
name: 'Contacts',
value: 'contacts',
},
{
name: 'Estimates',
value: 'estimates',
},
{
name: 'Products',
value: 'products',
},
{
name: 'Projects',
value: 'projects',
},
{
name: 'Sales Invoices',
value: 'sales_invoices',
},
{
name: 'Time Entries',
value: 'time_entries',
},
],
default: 'contacts',
},
{
displayName: 'Operation',
name: 'operation',
type: 'options',
options: [
{
name: 'Get',
value: 'get',
description: 'Get record(s) of the specified Resource',
},
{
name: 'Add',
value: 'add',
description: 'Adds a new object of the specified Resource',
},
{
name: 'Add Note',
value: 'addNote',
description: 'Adds a new Note to the specified Resource',
displayOptions: {
show: {
'/resource': [
'contacts',
'estimates',
'sales_invoices',
'time_entries',
],
},
},
},
{
name: 'Edit',
value: 'edit',
description: 'Edits an object of the specified Resource',
},
{
name: 'Delete',
value: 'delete',
description: 'Delete a record by Id',
},
{
name: 'Delete Note',
value: 'deleteNote',
description: 'Delete a note by Id',
displayOptions: {
show: {
'/resource': [
'contacts',
'estimates',
'sales_invoices',
'time_entries',
],
},
},
},
],
default: 'get',
description: 'Operation to perform',
},
As you can see in my code I want the addition and deletion of notes to be possible for certain resources not all. Now I get them shown for all with this setup: