Bug: Dynamic data source for option lists broken by page refresh

  • Goal: I want to have dynamic per-row options in the drop-downs for the "Active machine input" column.

  • Steps:

I have this basically working, except it breaks every time I refresh or load the page. This is what I see when I load my page (note that the "Active machine input" column just has meaningless numbers in it):

But all I have to do is go into the settings for the Option List on Active machine input, and perform some trivial insignificant change (e.g. adding a space to the 'Caption' field):

And suddenly the dynamic drop downs are filled in and working perfectly, just like I want:

But, if I reload the page, it's broken again (and the same for any other users who need to use this interface.) The only way I can make it work is by editing it and performing an doing any trivial/significant change to the options settings. So this really seems to be a bug with Retool.

  • Details:

getMachine SQL:

SELECT
	MachineKey,
	MachineName,
    MachineDataSourceId,
    FactoryDataSourceId,
    MachineClassKey,
    ActiveMachineInputKey,
    TenantKey,
    IsDecommissioned,
    WarehouseCode,
    MapWarehouseCodeTo

FROM 
	dbo.Machine

getMachineInput SQL:

SELECT
	mi.MachineInputKey,
	mi.Name,
	mi.MachineInputDataSourceId,
	mi.MachineKey

FROM 
  dbo.MachineInput mi

getMachineWithInputs transformer JS:

var machines = formatDataAsArray({{ getMachine.data }});
const machineInputs = formatDataAsArray({{ getMachineInput.data }}); 

machines.forEach(m => {
  m.MachineInputOptions = machineInputs.filter(mi => mi.MachineKey == m.MachineKey);
});
 
return machines;
  • Screenshots:


Hello @Tobert!

Apologies for this issue, let me see if I can reproduce the behavior. Thank you for all the screen shots.

Could you share via a screen shot what the data that is being used for "Active Machine Input" looks like? In your second screen shot if you mouse over the data source specifically {{currentRow.MachineInputOptions}}

I am guessing that "Active Machine Input" column is receiving an array of strings as the list of options but just wanted to confirm.

The one other thing I noticed is that in your very last screenshot, when you inspect the table and click on "Active Machine Input" it shows the Format. It looks like the format is set it "Tag" when I think it should be set to "Tags" plural :sweat_smile:

Potentially the table is incorrectly thinking it should only display a single tag/option, but then when you edit the column it realizes it should be Tags and switches over to properly show multiple options as a list of Tags.