Dropdown load from JSon request

Hi.

Can someone tell me how fill dropdown from Json return from API?
Tanks.
Joe.

Hey @joseo

Can you explain in more detail what you are trying to achieve? I’m not sure I understand your request.

Cheers,

SP

Hi.
Sorry, I need fill dropdown from a list of Street in Json format from API.
Tanks.
jose

@joseo see my answer here Dropdown modification dynamically

Hi.
Excelent I’ts Works
I fill Session with values fron API, format like “{ label: ‘Option 1’, value: ‘opt1’ },”
but not in dropdown, i think that is a var scope ?
Print the value in log is ok in format.
Any sugestion?

put the code Down…

// ********
session.calles = calles
const payloads = await bp.cms.renderElement(
‘dropdown’,
{
message: ‘Seleccione la Calle:’,
buttonText: ‘Click Aqui luego de Seleccionar la Calle’,
options: [
/*

      */
       { label: 'Option 1', value: 'opt1' },
      { label: 'Option 2', value: 'opt2' },
      session.calles
    ]
  },
  event
)
bp.events.replyToEvent(event, payloads)

}

//******

Tanks
Joe