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 ExchangeJanBask 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.
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
Using Maps in Apex (beginner)
I’ve been learning Apex for a little bit now and have a pretty novice understanding of how it all works, but the concept I’m struggling with the most is using maps instead of lists or sets. Does anyone have good reference material or examples on when Map is useful/what’s really happening in the background? I feel like I’m really close to fully grasping it, but there’s still something missing where I’m not fully understanding the value... More on reddit.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
Apex Map<String,Object> need to get object values - Salesforce Stack Exchange
You are really working uphill by doing this all untyped, but you can get the value you want this way: list l = (list) meta.get('addressDetails'); map m = (map) l[0]; Integer i = (Integer) m.get('addressId'); Honestly, if you make use of the Apex type ... More on salesforce.stackexchange.com
How do I get all keys or all values from an Apex Map?
Call keySet() to get a Set of every key, and values() to get a List of every value. keySet() is handy for binding into a SOQL IN clause, while values() gives you a list you can iterate or pass straight to DML.
micropyramid.com
micropyramid.com › home › blog › salesforce › apex map methods in salesforce: a complete guide
Apex Map Methods in Salesforce: A Complete Guide | MicroPyramid
What is a Map in Salesforce Apex?
A Map is an Apex collection of unique key/value pairs. Each key maps to exactly one value, keys must be unique, and both keys and values can be any data type — primitives, sObjects, or custom classes. You use it to quickly look up a value by its key.
micropyramid.com
micropyramid.com › home › blog › salesforce › apex map methods in salesforce: a complete guide
Apex Map Methods in Salesforce: A Complete Guide | MicroPyramid
Are Apex Map keys case-sensitive?
Yes. For String keys, 'Account' and 'account' are treated as two separate keys, even though the Apex == operator compares strings case-insensitively. Normalize the case, for example with toLowerCase(), before using strings as keys if you want case-insensitive behavior.
micropyramid.com
micropyramid.com › home › blog › salesforce › apex map methods in salesforce: a complete guide
Apex Map Methods in Salesforce: A Complete Guide | MicroPyramid
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.
Reddit
reddit.com › r/salesforce › using maps in apex (beginner)
r/salesforce on Reddit: Using Maps in Apex (beginner)
September 23, 2020 - With a Map<Id, SObject> you can simple do a Get statement to return the record with the matching Id. Thinking them as a way to arrange data for easy retrieval later. ... Think of a Map like a dictionary in real life.
Forcetalks
forcetalks.com › salesforce-topic › how-can-i-get-value-in-map-from-json-in-apex
How can I get value in MAP from JSON in Apex? - Salesforce® Discussions - Forcetalks
Hi, Map<String, Object> m = (Map<String, Object>) JSON.deserializeUntyped(jsonInput); Map<String, Object> m2 = (Map<String, Object>) m.get('info5'); List<decimal> d = new List<decimal>(); for(String s:m2.keyset()) { decimal t = (decimal) m2.get(s); d.add(t); }
S2 Labs
s2-labs.com › home › map initialization methods in apex
Map Initialization Methods In Apex | Salesforce Developer Tutorials
April 27, 2026 - 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 writing nested loops. No, in Apex, a Map cannot have duplicate keys. ... Subscribe to our newsletter to receive updates on the content that matters to you. ... Get up to 20% OFF on your favourite courses.
Top answer 1 of 2
9
You are really working uphill by doing this all untyped, but you can get the value you want this way:
list<Object> l = (list<Object>) meta.get('addressDetails');
map<String,Object> m = (map<String,Object>) l[0];
Integer i = (Integer) m.get('addressId');
Honestly, if you make use of the Apex type system, you will have an easier time working with the data. If you create a class for the incoming data structure, abbreviated as:
public class Meta{
public list<addressDetail> addressDetails {get; set;}
public class addressDetail{
public Integer addressId {get; set;}
}
}
you will be able to access the data from your JSON strings as so:
Meta MyMeta = (Meta) JSON.deserialize(viewPersonValue,Meta.class);
system.debug(MyMeta.addressDetails[0].addressId);
2 of 2
2
May be this simple example can help
string viewPersonValue = '{"name":"John",
"age":30,
"cars":
{"car1":"Ford",
"car2":"BMW",
"car3":"Fiat"}
}';
Map<String, Object> meta = (Map<String, Object> JSON.deserializeUntyped(viewPersonValue);
Map<String, Object> carMap = (Map<String, Object>) meta.get('cars');
system.debug(carMap.get('car1'));
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 - The keys in a Map must be unique and are used to access the corresponding values. Apex provides several methods to manipulate these entries, such as put(), get(), and remove(), offering developers powerful tools to manage data effectively within their applications. 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
YouTube
youtube.com › shorts › 4OR3UUF-Inw
Retrieve value from a Map in Apex #coding #sfdcstop #salesforcedeveloper #shorts #programming - YouTube
Aloha Trailblazers, Let's learn how can we retrieve a value from a Map in apex using the key
Published: March 12, 2025
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.
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 very powerful while using Apex Code in Salesforce · Map<String, String> countryCurrencies = new Map<String, String>(); List<String> ABC = new List<String>(); #1 - Map<String, Integer> accountMap = new Map<String, Integer>(); accountMap.put('Acme', 10000); accountMap.put('XYZ Corp', 5000); accountMap.put('ABC Company', 7500); // Retrieve the value for a specific key Integer acmeValue = accountMap.get('Acme'); System.debug(acmeValue); // Outputs 10000 #2 - Map<String, Integer> accountMap = new Map<String, Integer>{ 'Acme' => 10000, 'XYZ Corp'=> 500 }; Boolean exists = accountMap.containsKey('Acme'); // exists = True accountMap.keySet(); // Returns the Set<Data Type of the Map Key> accountMap.values(); // Returns the List<Data Type of Map Value> Set<String> accountNameSet = accountMap.keySet(); List<Integer> revenueList = accountMap.values(); #3 - Map<String, Integer> accountMap ·
SFDC Kid
sfdckid.com › 2019 › 04 › salesforce-apex-collection-map.html
APEX COLLECTION: Map - SFDC Kid
Salesforce Apex Collection : Map Salesforce Apex Collection is a collection of key-value pairs where each unique key maps to a single value. salesforce Apex Collection in simple and easy steps starting from basic to advanced concepts with examples including salesforce Overview, salesforce Architecture, salesforce Environment, salesforce Sales, salesforce Service Cloud, salesforce Navigating Setup, salesforce Standard, salesforce Custom Objects, salesforce Master Detail Relationship, salesforce Lookup Relationship, salesforce Schema Builder, salesforce Control Access to the Organization, Contro