Custom app dynamic dropdown options not initiated in freshsales mobile app

Custom app dynamic dropdown options not initiated in freshsales mobile app but works perfectly in web app.

Hey @Vanitha,

Welcome to the Freshworks Developer Community! :tada:

Can you give me more details about the dropdown and where in the custom app are you referring to?

We have created a custom app with coupon code dropdown, the coupon codes should be dynamically loaded from API. Used the below code in app.js in onAppActivate function and it is working perfectly in web version but not showing in the FreshSales mobile app.

await client.request.invokeTemplate(‘getCouponDropdown’,
{
context:{view_id: “##########”},
query:{“page”: “1”}
}).then (
function(data) {

const coupons= JSON.parse(data.response);
const coupondata=coupons.cm_coupons;

const options=[];
for (var i = 0; i < coupondata.length; i++) {
    options.push({'text':coupondata[i].name,'value':coupondata[i].name});
 
}
options.push({'text':'Others','value':'Others'});
var datatable = document.getElementById('coupon_code');
datatable.options = options;

},
function(error) {
console.log(error);
});