Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Example of Parameters in Nodel
param_parameterRequiredString = Parameter({'title': 'Parameter Required String Example', 'schema':
{'type':'string', 'required': True}
})
param_parameterNotRequiredString = Parameter({'title': 'Parameter Not Required String Example', 'schema':
{'type':'string', 'required': False}
})
param_parameterInteger = Parameter({'title': 'Parameter Integer Example', 'schema':
{'type':'integer', 'required': False}
})
listExample = ['option 1', 'option 2', 'option 3']
param_parameterList = Parameter({'title': 'Parameter Dropdown Example', 'schema':
{'type': 'string', 'enum': listExample}
})
param_parameterMembers = Parameter({'title': 'Parameter Members Example', 'schema':
{'type': 'array', 'items':
{'type': 'object', 'properties':
{
'string1': {'title': 'string1', 'type': 'string', 'required': False, 'order': 1},
'string2': {'title': 'string2', 'type': 'string', 'required': False, 'order': 2},
}
}
}
})
def main(arg=None):
print('Node started')
if(lookup_parameter('parameterRequiredString') != None):
print('Parameter Required String Example: ' + lookup_parameter('parameterRequiredString'))
if(lookup_parameter('parameterNotRequiredString') != None):
print('Parameter Not Required String Example: ' + lookup_parameter('parameterNotRequiredString'))
if(lookup_parameter('parameterInteger') != None):
print('Parameter Integer Example: ' + lookup_parameter('parameterInteger'))
if(lookup_parameter('parameterList') != None):
print('Parameter Dropdown Example: ' + lookup_parameter('param_parameterList'))
for member in lookup_parameter('parameterMembers') or []:
if(lookup_parameter('parameterMembers') != None):
print('Parameter Members Example:')
print(' string 1: ' + member.get('string1'))
print(' string 2: ' + member.get('string2'))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.