Let’s say I have those two dynamic dropdowns in an action (linked to hidden triggers):
inputFields: :
{
key: 'organization',
type: 'string',
dynamic: 'organizationList.id.name',
},
{
key: 'team',
type: 'string',
dynamic: 'teamList.id.name',
},
]
When the end user selects an organization, the team dropdown passes the organization id in its request to the API. Consequently, the the team dropdown is populated only with teams from the selected organization.
perform: async (z, bundle) => {
let params = {}
if (bundle.inputData.organization) {
params.organization = bundle.inputData.organization
}
const options = {
url: `${process.env.HOST}/v1/teams`,
method: "GET",
params
};
return z.request(options).then((response) => {
response.throwForStatus();
const result = z.JSON.parse(response.content);
return result.teams
});
},
Now my question is, if the end user, goes back to the organization dropdown and selects another organization how can we bust the cache of the team dropdown and make another request to the API with the organization id so the teams of this other organization are shown in the dropdown?