subtitle:'={{$parameter["mode"]==="binaryToJson" ? "Binary to JSON" : "JSON to Binary"}}',
description:'Move data between binary and JSON properties.',
defaults:{
name:'Move Binary Data',
color:'#7722CC',
},
inputs:['main'],
outputs:['main'],
properties:[
{
displayName:'Mode',
name:'mode',
type:'options',
options:[
{
name:'Binary to JSON',
value:'binaryToJson',
description:'Move data from Binary to JSON',
},
{
name:'JSON to Binary',
value:'jsonToBinary',
description:'Move data from JSON to Binary.',
},
],
default:'binaryToJson',
description:'From and to where data should be moved.',
},
// ----------------------------------
// binaryToJson
// ----------------------------------
{
displayName:'Set all Data',
name:'setAllData',
type:'boolean',
displayOptions:{
show:{
mode:[
'binaryToJson',
],
},
},
default:true,
description:'If all JSON data should be replaced with the data retrieved<br />from binary key. Else the data will be written to a single key.',
},
{
displayName:'Source Key',
name:'sourceKey',
type:'string',
displayOptions:{
show:{
mode:[
'binaryToJson',
],
},
},
default:'data',
required: true,
placeholder:'data',
description:'The name of the binary key to get data from.<br />It is also possible to define deep keys by using dot-notation like for example:<br />"level1.level2.currentKey"',
},
{
displayName:'Destination Key',
name:'destinationKey',
type:'string',
displayOptions:{
show:{
mode:[
'binaryToJson',
],
setAllData:[
false,
],
},
},
default:'data',
required: true,
placeholder:'',
description:'The name the JSON key to copy data to. It is also possible<br />to define deep keys by using dot-notation like for example:<br />"level1.level2.newKey"',
},
// ----------------------------------
// jsonToBinary
// ----------------------------------
{
displayName:'Convert all Data',
name:'convertAllData',
type:'boolean',
displayOptions:{
show:{
mode:[
'jsonToBinary',
],
},
},
default:true,
description:'If all JSON data should be converted to binary.<br />Else only the data of one key will be converted.',
},
{
displayName:'Source Key',
name:'sourceKey',
type:'string',
displayOptions:{
show:{
convertAllData:[
false,
],
mode:[
'jsonToBinary',
],
},
},
default:'data',
required: true,
placeholder:'data',
description:'The name of the JSON key to get data from. It is also possible<br />to define deep keys by using dot-notation like for example:<br />"level1.level2.currentKey"',
},
{
displayName:'Destination Key',
name:'destinationKey',
type:'string',
displayOptions:{
show:{
mode:[
'jsonToBinary',
],
},
},
default:'data',
required: true,
placeholder:'data',
description:'The name the binary key to copy data to. It is also possible<br />to define deep keys by using dot-notation like for example:<br />"level1.level2.newKey"',