-
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: