Hi, your support for feeding the channel and group list to installation parameter where I followed the documentation to set the channel list to installation parameter by following the steps below but failed to fetch
@Abdul_Ghani,
Good day!
Seems like ChannelNames variable is defined inside a function and trying to access outside, which won’t work, you need to pass the channelNames values to resolve function and get it when promises resolved
and you need to wait for the promise to be resolved before setting the utils.set
eg:
var p = new Promise((resolve, reject) => {
client.request.get(url, options).then((data) => {
let channelNames = [];
const channels = data.channels;
for (let i=0; i< chanels.length; i++) {
channelNames.push(channels[i].name);
}
resolve(channelNames);
});
});
p().then((channelNames) => {
utils.set('channel_list', {values: channelNames, label: 'channel list changes' });
});