You need to sign in to do that
Don't have an account?

how can i separate value from key value pair in Map salesforce lightning ?
Hi i have a one requirement i need to saparate values in a map i am geeting id and value in salesforce lightning
'{"0053i00000213MhAAI":"Sarah Orosco","0053i00000215NfAAI":"Diana Chavez","0053i00000218YZAAY":"Shannon Fortner","0053i0000021AQ6AAM":"Sharon Snyder","0053i00000215HJAAY":"Diana Karch"}'
getting output like above i need to store names in one list how can i do that in salesforce lightning aura component .
below is my code
doInit: function(component, event, helper) {
// Create the action
let action = component.get("c.retrieveAgentDMName");
// Add callback behavior for when response is received
action.setCallback(this, function(response) {
let state = response.getState();
console.log('response.getState()'+state);
if (state === "SUCCESS") {
console.log("Success" +response.getReturnValue());
console.log("stringify"+JSON.stringify(response.getReturnValue()));
component.set("v.agentsNameWrapper", response.getReturnValue());
component.set("v.agentsNames", JSON.stringify(response.getReturnValue().useridToNames));
}
please help me on this .
Thank you ,
Surender Reddy
You Can Refference Below Code Please Mark It As best Answer If It Helps
Thank You!
please take the referrence from below links:
https://sfdcmonkey.com/2016/11/16/how-to-use-map-in-lightning-component/
https://jayakrishnasfdc.wordpress.com/2018/09/15/iterate-map-values-in-salesforce-lightning-component/
If you find your Solution then mark this as the best answer.
Thank you!
Regards,
Suraj Tripathi