Dev Space

Customize & extend the power of Alteryx. SDKs, APIs, custom tools, and more!

External Source - Listbox HTML GUI SDK

Alteryx Certified Partner
Alteryx Certified Partner

Second question from me today.


I've previously created a HTML GUI tool which populates a dropdown using the meta-info from the macro input, and i've succesfully transferred this logic to work for a listbox; however, in this sitatuation, we want to use the option to get the data from an external source.


Could anyone advise on how I could look to do this?


At present my HTML  for the listbox selector looks like...


          <h2>XMSG("Select the field containing your task content")</h2>
        <ayx data-ui-props='{type:"ListBox", widgetId:"TaskContent", searchable: true}' data-item-props='{dataName:"TaskContent", dataType:"FieldSelectorMulti"}'></ayx>

My understanding is that it's the data-item-props that forces the widget to pull data from the meta-info, but I'm not sure how I can amend this to work with an external source.



16 - Nebula
16 - Nebula

We're going deep today @BenMoss


So clearly this help is conditional on you not winning the SNES :)


You need to create the data item in JavaScript and its got some warts...


In the HTML do:

<ayx data-ui-props='{type:"ListBox", widgetId:"TaskContent", searchable: true}'></ayx>

Then within Alteryx.Gui.AfterLoad, do something like:


Alteryx.Gui.AfterLoad = function(manager, AlteryxDataItems) {
# ...
var fsm = new AlteryxDataItems.FieldSelectorMulti("TaskContent", { manager: manager } )
fsm.forceFieldInFieldList({strName: "James", strType: "Int16"})
manager.bindDataItemToWidget(fsm, "TaskContent")


It does seem to add missing but isnt far off what you need

You will need to amend the forceField bit to what you need


Good luck



16 - Nebula
16 - Nebula

MAN - I am in awe of you two - lots of catching up for me to do.