Ask a Question
Ask Question Login
Corporate Training
  1. Community
  2. Salesforce
  3. Question
Salesforce

How can I convert a json array of strings into a list of maps?

Asked by Clare Matthews Apr 19, 2023 1.1K views 1 answer
Share

About this question

String stringJSON = '[{"action":"ASSIGN","value":"Router"},{"action":"DISABLE","value":true},{"action":"HIDE","value":false}]';

Can anyone help me convert this JSON string into a List of Maps?

So the expected outcome is List.size() is 3 where each value is mapped so that I can get the Action and the Value?

  • List value 1 = 2 maps. The one is Action=ASSIGN and the other one is Value=Router.
    List value 2 = 2 maps again. The one is Action=DISABLE and the other one is Value=TRUE.
    List value 3 = 2 maps again. The one is Action=HIDE and the other one is Value=FALSE.

Your answer

1 Answer

More Salesforce discussions

Learn & Explore

Free tutorials and interview questions from industry experts — learn the skill, then get ready to prove it.

Latest Salesforce Blogs

Guides, tips and career advice on Salesforce from JanBask experts.