You may use a Map for this:
public static String manageFilters(Map<String, Object> lines){
System.debug('### lines : ' + lines);
System.debug('### lines.values() : ' + lines.values());
for(String key : lines.keySet()){
System.debug('### lines.get(key) : ' + lines.get(key));
System.debug('### >>> ' + lines.get(key));
Map<Object, Object> test = (Map<Object, Object>)lines.get(key);
System.debug('### test ' + test);
System.debug('### test ' + test.get('ObjectName'));
}
return null;
}
Answer from S.. on Stack ExchangeHow to get values from a map apex?
I have a map passed as a parameter of an apex method. In this method I need to get the values of the map. Here is the apex method :@AuraEnabledpublic stati... More on janbasktraining.com
How to check if a Map contains a given value in Apex Salesforce? - Stack Overflow
How can I verify, with apex, if a given value is contained in a Map? More on stackoverflow.com
How to display Map's list value based on 1 key in Apex Salesforce? - Stack Overflow
Hello beautiful people, I have a scenario where I am defining a Map with string key and a list. Now, I want to put values in a list one by one and also display them using the single Key. Example co... More on stackoverflow.com
dictionary - How to increment a value in a map with Apex? - Stack Overflow
Is there a way to increment a value in a map without needing a second variable? More on stackoverflow.com
01:00
Extract keys and values from Apex Map #coding #sfdcstop ...
Apex Beginners' Guide: Navigating Collections - Mastering ...
20:44
Maps in Apex | Apex Collections | Chapter 31 | Salesforce Developer ...
02:25
Map in Apex Explained | Salesforce Developer - YouTube
Salesforce Apex Master Class (Ep. 19) - What are Maps in Apex? ...
07:17
Map Data Structure in Apex | Map Advanced Methods | Apex Data ...
Salesforce Developers
developer.salesforce.com › docs › atlas.en-us.apexref.meta › apexref › apex_methods_system_map.htm
Map Class | Apex Reference Guide | Salesforce Developers
Contains methods for the Map collection type.
JanBask Training
janbasktraining.com › community › salesforce › how to get values from a map apex?
How to get values from a map apex? | JanBask Training Community
September 23, 2022 - In Apex, you can get values from a map using the get() method or by directly accessing the map keys.
Levelupsalesforce
levelupsalesforce.com › convert-map-to-list
Apex Convert Map To List - LevelUpSalesforce
August 30, 2022 - To loop over map values in Apex we can also use the Map.values() method.
CRS Info Solutions
crsinfosolutions.com › home › what is a map class in salesforce apex? with examples
What is a Map class in Salesforce Apex? with examples
Salesforce Training - On April 22, 2024, Posted by CRS Info Solutions , In Salesforce,Salesforce Apex Tutorial, With Comments Off on What is a Map class in Salesforce Apex? with examples ... In Salesforce, a Map is a collection of key-value pairs where each unique key maps to a single value. I have enrolled for Salesforce Admin and development online course at CRS info solutions. It’s really the best training i have ever taken and syllabus is highly professional
S2 Labs
s2-labs.com › home › map initialization methods in apex
Map Initialization Methods In Apex | Salesforce Developer Tutorials
April 27, 2026 - Yes, we can initialize a map using SOQL if the map key is Id and the value is an sObject type. Salesforce automatically uses each record's ID as the key and the record itself as the value. Maps are used in Apex primarily to enable fast, efficient lookups by key, including record IDs without ...
Panther Schools
pantherschools.com › home › salesforce › how to use map collection in salesforce?
How to use Map Collection in Salesforce? » Panther Schools
April 21, 2025 - Map is the combination of Set & List where Key can not contain the Duplicate Records & Value can contain a duplicate value. Map is very powerful while using Apex Code in Salesforce
Forceshark
forceshark.com › blog › key-concepts-and-usage-of-maps-in-salesforce-apex
Key concepts and usage of Maps in Salesforce Apex | Blog
In Salesforce Apex, a Map is a collection type that stores key-value pairs. It is similar to a dictionary or hash map in other programming languages. In a Map, each key must be unique, and it is associated with a specific value.
Decodeforce
decodeforce.com › blogs › apex-map-class-methods-and-examples
Salesforce apex map class and methods with practice examples
Maps in Salesforce Apex are collections of key-value pairs. The keys are unique, and each key maps to a specific value.
Top answer 1 of 2
6
Replace
counts.put('month_total',counts.get['month_total']++);
with
counts.put('month_total',counts.get('month_total')++);
2 of 2
0
List<String> lststrings = new List<String>{'key','wewe','sdsd','key','dfdfd','wewe'};
Map<String,Integer> mapval = new Map<String,Integer>();
Integer count = 1;
for(string str : lststrings){
IF(mapval.containsKey(str)){
mapval.put(str,mapval.get(str)+1);
}
else{
mapval.put(str,count);
}
}
system.debug('value of mapval'+mapval);