#AlexElba

1 messages · Page 1 of 1 (latest)

neat jasperBOT
little dew
#

custom_fields is an array of hashes

#

So it need to be an array first, then one memeber is a hash with dropdown

balmy carbon
#

not sure what that will look like - I tried this does not work 'custom_fields' => [[ 'dropdown' =>
[
'label' => 'Investment Focus',
'key' => 'investment_focus',
'type' => 'dropdown',
'options' => [['label'=>'Realtor', 'value'=>'realtor'], ['label'=>'XXX', 'value'=> 'YYYY']],
'optional' => true,
],
]],

#

gives array key missing

little dew
#

Okie PHP question: How do you define an array of objects?

#

I think it's not [[

#

array(['dropdown' => ....], [...])

balmy carbon
#

if you give me example in other language works too

#

python, java etc

little dew
#

hmm you can choose PHP here actually

#
  'custom_fields' => [
    [
      'key' => 'engraving',
      'label' => [
        'type' => 'custom',
        'custom' => 'Personalized engraving',
      ],
      'type' => 'text',
    ],
  ],
#

umm it looks similar

#

can you try to copy-paste the code first to see if it works? before swithing to dropdown

balmy carbon
#

thanks I think it worked here is final version

#

'custom_fields' => [
[
'key' => 'investmentfocus',
'label' => [
'type' => 'custom',
'custom' => 'Investment Focus',
],
'type' => 'dropdown',
'dropdown'=> ['options' => [['XX'=>'TT']]
],
],

little dew
#

ah okie dropdown is same level with key or label