0

I am returning a map with -

DEBUG|mapCustomerCentricData{Assortment=10.0, Availability=12.0, Convenience=12.0, Internationalization=null}

when i am returning it to lightning

      if (state === "SUCCESS") {
            //set response value in wrapperList attribute on component.
            var StoreResponse = 
          response.getReturnValue().customerCentricDataMap;
            component.set('v.fullMap', StoreResponse);
            for (var singlekey in StoreResponse) {
                arrayOfMapKeys.push(singlekey);
            }

        } 

arrayOfMapKeys is showing only key which has data m but i want to display null value as a blank in table.

0

You have problem here:

for (var singlekey in StoreResponse) {
            arrayOfMapKeys.push(singlekey);
        }

arrayOfMapKeys should be javascript object. Try to change it into this:

let arrayOfMapKeys = {};
for (var singlekey in StoreResponse) {
    arrayOfMapKeys[singlekey] = StoreResponse[singlekey];
}
console.log("arrayOfMapKeys => ",arrayOfMapKeys);

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.