Note: I found this post: How to build a dynamic form in MacroConfig panel? - #7 by spall
And I tried the following, but it still isn’t working:
const Config = () => {
const [projectsData] = useState(Forecast.getProjects);
return (
<MacroConfig>
<TextField name='title' label='Title' defaultValue={DefaultConfig.title} />
<TextArea name='rowsConfig' label='Rows Config (JSON)' defaultValue={JSON.stringify(DefaultConfig.rowsConfig, null, 2)} />
<Select name='projectIds' label='Projects' isMulti={true}>
{projectsData?.projects?.map((project) =>
<Option label={project.client_name ? `${project.client_name}: ${project.name}` : project.name} value={project.id} />
)}
</Select>
</MacroConfig>
);
};
The Select Options are populated, but the saved value is not shown when the MacroConfig is edited after the save.