0

This question already has an answer here:

Assigning JSON string to apex:inputText

jQuery code:

$('*[id*=stageName]').val(JSON.stringify(final_array));

Apex & Visualforce:

 public String stageName{set;get;}
 <apex:inputText value="{!stageName}" id="stageName"/>

Getting below text into stageName in apex through jQuery

{
    "New":["Prospect","Open","In Negotiation","Final Negotiation"],
    "Readoption":["Won"],
    "Rollover":["Won","Invoiced","Lost"],
    "Upsell":["In Negotiation","Lost"],
    "Conversion":[]
}

How to convert this JSON text into apex map like Map<String,List<String>>

marked as duplicate by glls, David Reed, Himanshu, Oleksandr Berehovskyi, crmprogdev Jun 27 '18 at 12:41

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

1

Do something like,

String jsonInput = '{"New":["Prospect","Open","In Negotiation","Final Negotiation"],"Readoption":["Won"],"Rollover":["Won","Invoiced","Lost"],"Upsell":["In Negotiation","Lost"],"Conversion":[]}';
Map<String,List<String>> m = (Map<String,List<String>>)JSON.deserialize(jsonInput, Map<String,List<String>>.class);
  • Please review How to Answer and provide an explanation to the above. – glls Jun 27 '18 at 0:05

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