 Hello, hi everyone. I'm Sanjay Gupta. I welcome you on Sanjay Gupta Tech School. So you can see today I am doing day 37 of this Salesforce learning bootcamp and today we will be completing collection data type. So we will be discussing about map in Apex. So in previous two sessions we discussed about list and set. So let's discuss how we can implement map as a data type in Apex. And I hope you have already gone through the practice exercise of list and set and you understood them very well. Still if you are having any issue or doubt, so you can reach out to me on Telegram group or you can ask your doubts in the comments of YouTube. So once again, I welcome everybody. So I'm just waiting for couple of more minutes so that more folks can join and then we'll be starting. So hi and welcome to everyone. Okay, so I can see numbers are increasing more than 50 folks are live. So I'm very happy and like it gives me lots of energy to do live sessions frequently every week so that I can just give and share my knowledge and can connect with a beautiful community. And today I just shared a PDF in the Telegram group. So if you are not part of the Telegram group, then just join that. So there you will find a PDF which will be having LWC related questions and answers. So if you are going for an interview where you want to prepare yourself for LWC interview, so in that Telegram channel you can find. So if you need the link, so I can just share it with you. So I'm just going to share the link with you. So I'm just pasting the link in the chat. So if you want, you can just join this Telegram group. So actually you need to subscribe. So in this group, I only I can send the messages. So if you subscribe this Telegram group, so you will be having all the messages available that I sent till now. So it is just clean group where I'm only sending the notifications. Okay, so moving forward, if you have joined this session today only and you don't know about me, so this slide will help you to know about me. So I have total 16 plus years of experience and whatever I have done so far. So everything is listed on this slide. And we are following this virtual learning best practices. So I can see Telegram group, everybody, those who are being practiced, they're asking questions, they're answering questions to other folks. And I'm very happy like I'm able to build a community where I think 1500 numbers we are going to hit soon. So it is having more than 1300 members in that Telegram group. And I just started that in last month. So I'm very happy, like in very less time, I'm able to add lots of folks there. And as I told you, soon, we will be starting bootcamp on cybersecurity. So a separate Telegram group will be created for that. So that Salesforce will be separate and cybersecurity will be separate. And in Salesforce also, cybersecurity is a job profile. So it will be helpful for those who want to learn that skill. So again, I just want to iterate all these steps, like if you are not following such just follow all the exercises, do practice more and more so that you can have enough confidence on the solutions that you are building. And yeah, this is my favorite slide. And like daily whenever I wake up, so I just think about this slide only, or you can say the word consistency. So if you are consistent enough, then you can achieve anything, right? So whatever I try to do, I keep myself consistent. So you can see this bootcamp is the live example of that. I am doing this bootcamp consistently every week and three to four days in a week, I'm doing sessions. So if you are on learning side, you also need to do things consistently, right? So do regular practice. And like if you do regular practice, so basis on your efforts, you will surely get whatever you want, right? And you are not paying anything. So there will be no loss, right? So you are just gaining the things. So just don't think, keep consistent practice on daily basis. Okay, so yes, I will be sharing admin and dev PDFs. So I just decided on daily basis like I will be sharing one PDF. So I have total 11. So I just shared one PDF today. So soon I will be sharing others as well. Okay, so today we'll be discussing the topic will give you demo. And if you still have doubts, so live, you can ask lots of questions as we are doing daily basis. And it's still after the session if you have any question. So we have two platforms. So people are utilizing self help group mostly. So you can also become part of that. If not, then you can ask questions in the comment section. Chandan, I think this is the issue of YouTube. So no worries, you can ask questions in the telegram group. I will answer there. And here you can see we are in week 10. So soon, all the topics will be completed. So today we are discussing about map. And tomorrow we will discuss about conditional statements, then we'll discuss about loop statements. So if you have not gone through the excess, sorry, if you have not gone through the session tracker, so just go through. And as I promised you soon, I will be updating that sheet so that like lots of folks are demanding integration related session. So I am able to find someone who can deliver integration sessions. So I will be updating that sheet once I have the like topics or the content that will be delivered as part of integration. So soon this this like Excel sheet will be updated. So if you are not following, keep following and keep an eye on that. And just follow Sanjay Gupta Tech School everywhere on YouTube, LinkedIn, Instagram and Telegram. So like I know you guys frequently use Instagram and Telegram. So just follow me on Instagram and Telegram so that you don't miss any notification. Okay, and all the PDFs will be shared in the Telegram channel. The link I shared in the chat. So if you have not joined, just subscribe that so that you don't miss any notification. And if you want to show gratitude or support this channel for good cause because we are doing everything for free, of course, for the community. So just help me to reach 100 K subscribers as soon as possible. So this is the target which I decided for myself for this year. And I need your help because without your help, I wouldn't be able to achieve this number. Right. So I'm doing everything for you. Just in return, if you share this channel with all the groups, wherever you are part, so it will helpful for me. Okay, so let's come to the topic now. We are going to discuss about map in Apex. So first of all, we need to understand what map is, right? So here you can see lots of points are listed. And if we talk about map, so map is also a collection data type, but it is different from list and set. So in case of list and set, we only store one value at single place. But here whenever you want to store a value, so there will be a pair, pair of key and value, right? So if you are storing any value, so you just need to decide the key as well for that value. Okay. And you need to remember keys are always unique. Keys are always unique and having a value associated, right? So if you are if you are creating a map, so in map, you won't be able to have duplicate keys, right? And values can be duplicate. Now there may be a question, what happens if I add duplicate key? So in the fourth point you can see it says adding a map entry with an existing key overrides the existing entry with the new. So your existing entry will be removed and the new entry with new value will be available in the map, right? So this you need to make sure. So sometimes by mistake, what we do, we just store a new value with the same key, which is already available in the map. So due to this, your existing value will be overridden by the new value, right? So next is map key and value can contain any collection and can contain nested collections. So we have two terms here, key and value. So for this key and value, we need to decide data types as well. So key and value can be of any data type. It can be primitive, it can be collection, it can be S object, user defined type or built-in type. So again, user defined types and built-in types means Apex classes, right? So Apex classes are also used as a data type. So any data type you can use as key and value, okay? So this is brief about map that you need to remember. And if you want to see how it will be represented in our table format, so here I have created a map, map of integer comma string. So what you need to understand, the first data type integer will be always key and the second data type string will be always value, right? So this is the syntax. First data type will always be considered as key and second data type will always be considered as value. Then colors is the name of variable. Then through new map, we are just initializing it. Now in list and set, we have add a method through that we just add the values. But in case of map, we have put method. So through put method, you will be able to add the values in the map. And you can see the put method syntax. First you need to add the key, then comma and then value. And you need to respect all the data types. So if key is of integer, then you need to pass first parameter as integer. If value is of type string, so you need to pass second parameter as string. Okay, now here you can see this way it will be associated. So key value. So at one place there will be two terms. One is key and red is value. Then on second place we have key as two and value as green. So this way key value pair is available here, right? So here you can see we have lots of examples. So it will clear lots of your doubts. So I can see Asit is asking can key be a string? So yes. So by seeing the slide, you can just see we can have any data type as key. We can have any data type as value. Okay. So someone is asking example of nested list. So I will be explaining that later on because that is too complicated. So I don't want to interrupt the pace through which we are going. So once you understand the loop, when I will be explaining the loop, then I will be explaining the nested list. Okay, very good. I hope this will help you understanding the things. And so here what you can see, lots of examples are available. So just go through with each line by line. So first one is map of string comma string. So key and value can be of same data type. Key can be integer. Value can be string. Key can be ID. Value can be account. Key can be ID account. Key can be account and value can be list. So this way you can have any combination while you are creating a map. Right. So I will give you a few examples. So first we'll see primitives and then I will show you how S objects we can use in the map. Right. So Nagarjuna map is unordered. Here, here also we don't have any indexing. So we have key value pair. So if you want to search anything, so you can search that value basis on the key. Okay. So now moving forward, so we have lots of methods that we need to understand. So now one by one, I will be explaining so that you can understand how we can use map in apex. So jumping to our developer console. So first of all, I'm going to write the code here in anonymous window so that you can understand like we can execute map directly through anonymous window as well. Then after that, I will be creating a class and then I will show you how you can call that class and execute. So here I'm creating a map of integer comma string naming it as colors new map of integer comma string. So this way I just created a map. And in this map, I'm going to add the value. So I'm using put method. So here you can see input method you need to pass first parameter as key and second parameter as value. So our key is of type integer and values of type string. So here I'm passing values this way. So I just want to show you like we can have duplicate values but keys should be different. So here you can see one is the key green is the value two blue three red and four blue. So blue is available twice, but at both the places key is different. So if I want to show you the result through system dot debug. So here we can write colors. So this way this map is created. And in this map we have key value pair and I'm just displaying the complete map on the UI. Sorry, not on the UI in the debug. So locks will be opened and we will be able to see the debug only. So I'm just clicking on execute. So locks are being opened and I'm just checking the debug only checkbox and here you can see the results. So one equals to green two equals to blue three equals to red and four equals to blue. So if keys are unique, then duplicates are allowed as value. But if you put duplicate key, then previous value will be removed with the new one. Right. So if you want to see that example, so what will happen if I write it like this. So I'm putting key as two and here value I'm putting as yellow. So what will happen this value will be erased to blue will be raised. So I'm just going to show it this way. So first colors map will be displayed and it will show all four values. Then I'm putting key to and value yellow. So two blue will be replaced with two yellow. Right. So I'm just executing this code so that you can understand the result. So locks are generated here and so here you can see the locks are available. So here one is green two blue three red four blue then one green two is changed now it is having yellow. Right. So I hope this way you are able to understand the working off map through anonymous window. Now I'm just copying the same code and I'm going to create a class. So naming it as map demo classes being created and here I'm going to paste. Okay, before that I'm creating a method. Okay, so I hope now you can understand how we can create class and method. So in this class and method this code is available now if I want to run it. So I just need to write map demo dot demo and this way I can execute it. So I'm executing it again so that I can show you the results. So here you can see the same results are available. Okay, so this way I just showed you both the ways like how you can implement map code in anonymous window as well as how you can implement it in the class. So next we have put all so put all means if you want to merge two maps. So how you can do that so for that I need to create one more map with same key and value data type. Right. So naming it as more colors. Right. And here in this more colors map I'm just adding 1020 and here black, white, right? Now if I want to add so I can write colors dot add all and here I can write more colors. So what will happen whatever key value pair are available in more colors map. So those will be merged with this colors. Okay, put all not add all it should be put all. So my bad I just corrected it. So it should be put all because in map we cannot use add. Right. So this way it will be merged and now I'm going to show this one colors because merged values will be available in the colors map. Okay, so this way it is implemented. Now I'm going to execute it. So here I'm just checking debug only so you can see the results. So 1234 these key and value pair are for colors then 1020 this came from more colors map. Right. So if you want to merge two maps, then you can do it through put all and if you have same keys in both the maps. So the keys which are available in colors map that will be available. So let's see I think it will be replaced. So if we do that test as well. So let's see what happens if we have more colors and here I am adding one comma let's say pink. So above one is having green and in more colors it is one and pink. So what will happen let's see. So I'm executing this. Yeah, so here you can see one pink is not added because that colors map is already having that key associated. So only unique keys will go to that colors map those keys which are duplicate they won't be added. Okay. So Sanjeev you are asking keys. I said keys are unique. So yes, keys are unique. That's why I'm just adding it again. So while I am adding this key and value so this will be replaced. This two and blue will be erased and with key two value will be yellow. Okay, so we can put duplicate keys but in that case what will happen previous key value will be erased and new key value will be added into the map. Right. Then we have next put all and here we are passing s object array. So s object array means list. Okay, so here I'm going to show you that example. So for that I'm creating one more method public static void. So here this is s object demo. So I am naming it as like this. Now I'm creating a list of account right then I'm creating map map of ID comma account. Okay, now I am going to apply an SOQL. So this is a simple SOQL which I already discussed with you and we will discuss about SOQL in detail in next week. So right now you can just you can just understand this SOQL will be querying five account records and all those account records will be available in this acc list. Right. Now above we created a map. So what you can do you can just use this map and write put all and here you can pass acc list. So now what will happen from this account list all the IDs will become the key. Right. All the IDs will become the key because key is our ID and all the values like name and other fields will go to this value part. Okay, and this will happen automatically with this method put all. So if you pass a list into map so map combination should be like this key should be ID and the value should be that particular s object for that you are just using the list. Okay, now I'm just saving this and I'm going to call this method here executing this. So if we go to debug only. Okay, I just forgot to display it. So if you don't write it like this way you won't be able to see any result on the debug clock. So just executing it again. So in the logs I'm going to show debug only and here you can see the results right. So see it carefully what is happening here. So initially we have this ID which is the key and after key I hope you know we have equals to sign and after equals to sign we have account as value which is having ID and name both. So this is our one account key value pair. Then if I go here so again we have key as ID equals to then we have value value is having both ID and name. So this way s objects will be stored as a key value pair. Right. So if you want to query more than one field so that is also possible. So you can write phone as well. So all all that information will go to the value part. If you have lots of fields everything will be available in the value part and some Vamshi is asking how it will be added to map. So it is added to map through this put all method. So it is predefined like if you if you pass any list into this put all method. So all the IDs will become key and all the records will become the value of that map. Right. So again there is a question like if we have lots of field here so which will become the key so key will become ID always. Okay. Because if you place any other field so it can be of any type but ID is basically unique so it is predefined. So always use ID as a key and other things will go to the value part. Okay. If I show you this execution so in value you will see three things ID name and phone. So I'm running it again so that I can see I can show you the debug values. So here you can see okay I didn't think I executed it properly. Again I'm executing it debug only but it is not showing phone value. Okay. So maybe with these records there is no phone value available. That's why it is happening. So let me just fetch any other value. So I'm fetching created date right now I'm going to execute it again. So if there is no value that field won't be displayed. So if we see debug only so here you can see first we have ID then equals to then we have ID name and created it all all the fields which you are querying they will automatically go with the value part. And if any field is not having any value so that will be that will not be available here. Okay. So this way I hope you understood how we can convert our list into map. Right. So I'm just explaining this again. Someone is requesting Sanjeev is requesting to explain it again. So just understand it in clear way like put all is a method which converts list into map and whenever we convert list into map. So all the IDs will become the keys and all other field values will become the value in the map. Right. So this way you just need to remember this put all method. Okay. So there is one more question. What if we have to see the this SQL into columns. So I was can you please explain a little bit more. I didn't understand what you want to ask. And they've these asking can we use map with set so we can but set basically has unique values. So set and map combination we rarely use. Generally we use list map list set combination. Right. Gayatri answer to your question is because here in SOQL we are keeping ID as the first field. That's why it is available in the first place. If you write at the if you write name at the first place so let me just change the order so that you understand. So I'm writing them like this name ID and created date. Let's see what happens now. So I'm just saving this code and executing moving to debug only. So here you can see the changes. So key is still your ID but the value order is changed. Name is available first then ID is available and then created it. So so no is asking if we don't query ID what will happen. So this I never did. Let me test it in front of you what will happen. So I'm just executing it. Okay. What is happening whenever we are querying the record so basically ID is fetched automatically. But if we don't don't place that ID so it won't be available in the no it is available in the value part as well. So it will be available by default. If you don't place then also it will be available. Okay. So if you are not placing ID still it is available there. So I will explain use of map and trigger when we'll be discussing about trigger right now. We are just understanding the basics of map. So you are asking to see the result in column format. So that is not possible. We can see the result in different lines for sure. So for that basically you need to use the loop through loop you will be able to see the results in different lines. Okay. And I just don't want to explain loop right now because many people are beginner and they don't know how loop works. So day after tomorrow like on Thursday the session will be based on loop then I will show you all the things like how loop works with list set and map. So at that point of time you will be able to understand that thing. Right. So conditional statement and looping statement I'm just avoiding. So tomorrow we will understand conditional statement and day after tomorrow we will understand loop statement. So Avinash is asking can we query in a map so you can. So what you can do you can just copy and you can write it here. So whatever you are querying that will be converted into map automatically. So this is possible. Right. Yes. So no map can contain duplicate values. So here D-res is asking what is the limit five limit five means only five records will be queried. Right. Only five records random five records will be queried. Okay. So I'm just going to explain a few more methods then I will take the questions otherwise it will break the sequence. So I just explained put put all and put all which is related to list and map. Now we have next method which is remove. So if you have more question just send it in the chat. So I will pick those questions after the explanation. So next we have remove method. So basically remove method will be removing the value basis on the key. So here I'm going to apply it. So from colors map I'm going to remove the value which is available at key number one. Right. And key number one is having green. So green will be removed from the map. Okay. So here I'm using colors dot remove one one is the key that I'm passing and here I'm just showing the colors map. So I'm just saving this and this time I need to call this demo method. So I'm just changing the name here and I'm going to call it. So clicking on execute. So debug only and here you can see the result. So last line is not showing one equals two and that value. Okay. It is removed from the map. So if you if you want to remove value from the map so you can just use remove and pass the key that key and value pair will be removed automatically. Then we have size. So size is very easy. Like if you copy and paste it so we can just use color dot size. So map size will be displayed. So here I'm just checking debug only. So map size is five. So you can see it is having five values. So last last line is showing the updated values. So one two three four five five colors are available and map size is five. So key and value will be considered as one one value not two. Then we have values. So it is also interesting. So right now whenever we are displaying map. So map is displaying both key and value pair. Now what you want to do if you want to display all the values together only the values not the keys. So you can write it like this. So this method will be displaying all the values of the map only the values not the key. So here I'm writing map values saving it and I'm going to execute it. So you will see only map values in the last line. Here you can see. So it is showing map values. Keys are not available here. Okay. So this way sometimes we need only the value. So you can just use this values method. Then next we have clear clone. These are similar. We used like these methods and list and set. So if you use clear so data will be erased. So I'm going to show you that so colors dot clear and then I'm going to show it. So at last line you will see nothing will be shown. So here you can see line number 35 is showing map is blank because of that clear method. Okay. Now I'm going to show you how clone works. So for clone I'm just creating one more map. So naming it as cloned map writing it here and cloning it. So I'm just going to show cloned map here. Right. So colors map will be cloned and all the values will go to this cloned map and here I'm going to display it. So whatever values are available in the colors map those values will display with the help of cloned back. So I just saved it and I'm going to execute it. Now if I see the debug only so here you can see line number 36 is showing the same value as line number 32 and line number 36 is showing the cloned map. If you want to see the proof so at line number 36 we are displaying cloned map. So cloned map is having values from the colors through clone method. Okay. So this way I hope you understood it. Now we have contains key. So contains key is also an important method which will return true or false. So in contains key if you pass any value sorry if you pass any key in the contains key method. So contains key method will check whether that particular key is available in the map or not. Accordingly it will result it will show the result as true or false. So here I'm writing contains key and I'm writing 15 and again copying this pasting it and this time I'm writing key as 10. Right. So I have two statements line number 37 and 38 both are using contains key. So in the first one I'm passing key as 50 and in the second one I'm passing key as 10. So 10 is available but 50 is not available. So here line number 37 will display false and line number 38 will be displaying true. Okay. So this way you can just check whether particular key is available in the map or not. So I'm going to run it. So in debug only. Okay. I forgot to save the code. So I'm just saving it and I'm going to run it. So if we see the debug only so here you will have all the results. So you can see initially map is showing false like that 50 is not available and at second position line number 38 it is showing true like key 10 is available. So as a proof you can see 10 is available as a key but 50 is not available. So this way if you want to check whether particular key is available in the map or not. So you can do it with this contains key method. Then we have equals. So if you want to compare two maps are having same values or not. So we can do. So right now what I'm going to do I'm just comparing cloned map with colors and more colors. Okay. So first line number 39 will return true whereas line number 40 will return false because cloned map is basically cloned through colors map. So that's why it will be having equal values with colors map. But cloned map won't be equals to more colors. They have different values. So line number 39 will display true and line number 40 will display false. So I'm just saving this code and going to execute. Then I am just clicking on debug only. And here you can see first is showing true like cloned map and colors both are having same values but cloned map and more colors both maps are having different values. So it is showing false. Right. So this way I hope you are understanding each method one by one. Then we have get method. So get method is also very useful. So if you want to pass a key and basis on that key you want value in return then we use get method. Okay. So what will happen if you use it so I'm just pasting here cloned map dot get and here I am passing 10. So what will happen if this key is available in the map. So whatever value is associated with this key that will be returned. So I'm just saving this and going to run it. So here you can see it is showing black and if you verify so key 10 is having black as a value. Okay. So this way if you use get method so you will be able to fetch particular value basis on the key and then we have is empty. So it is very simple. So if you use is empty so it will check whether map is empty or not. So if it is not empty it will return false if it is empty it will return true. So right now this cloned map is not empty so it will be returning false. So I'm executing it and we will see the last line of the result and last line is showing false because our map is not empty. Okay. Now we have one more method which is key set. So key set is basically simple equals to values. So value through colors dot values we can get all the values together. But if you want to have all the keys together then you can use key set. So this way you can implement it. So at the last line you can see I'm having a method where like I'm having a debug statement where I'm using the method key set. So this statement will show all the keys together. So I'm just saving it and going to execute. So at last line you can see all the keys are available. Only the keys. Okay. So through this like if you want to store these keys into a set so that is possible. If you want to store all the keys of map into set so this way you can do key set. And if you want to store all the values into a list so this way you can do. Okay. So let me show you how you can store the values. So I'm creating set of integer int set and I'm creating a list of string. Right. So what I will do I will store the keys into that set and I will store the values into the list. So set name is int set equals to cloned map dot key set. So stores keys into a set then str list equals to cloned map dot values. So it will stores values into a list. Okay. So this way if you want to separate out keys and values of map into set and list so you can do. And after that you can just display to verify right. So this way I just use line number 50 and 51 to display set and list. I'm saving the code executing it and you will see the results. So here you can see. So first we are seeing map keys then set contains all the keys and list contains all the values. Right. So I hope this makes sense. So through list we created set. Sorry. Through list we created map and now through map we are creating set and list. So this way as per the requirement you can just use all these collection data types. So I think with this example we are able to use set list and map together. Okay. Now before taking all the questions I have two examples here that we are going to display. Right. And these are very easy. So here what we need to do we need to create a map of account ID and as key and account as value using loop and without loop. So without loop we already discussed. I will be showing you how we can use loop but without loop if you want to display the map with key and value map with all the keys and map with all the values. So this thing I am going to show you. So if we take this example. So what I'm going to do I'm going to implement it like this. So here what we are doing list list will be converted into map. So I'm passing list as a parameter here while creating map. So this list will convert into map and map will be having ID as the key and all the values as accounts. So here we are displaying whole map. Now if I copy and paste it twice. So map keys and map values. So for keys you can write key set method and for values you can write values method. So this is the solution for a requirement without loop. So what we did we created a list we queried five records with these two statements. Then that list we passed into the map constructor and that list will automatically convert into map. Then line number nine is showing all the map values keys together line number 10 will display all the keys and line number 11 will display all the values. So now I'm going to run it so that you can see the results. So here you can see in line number nine result we have ID as key equals to then we have values then again we have ID as key and then values then in line number 10 you can see you have all the IDs as key and line number 11 is showing all the values no key all the values. Okay. So this way you can just see whatever results you want to write. Now what I'm going to do I'm going to show you how we can convert list into map with the help of loop. So I'm just copying this method pasting here removing extra lines. So this is our method. Okay, so this is as object demo without loop. This is as object demo with loop. Okay, and later I will be converting this into a custom object. Okay, so this is with loop. So what will happen here we won't be passing the values. Instead after this I'm going to create a loop and if you don't understand the loop, so no need to worry because we will be having a separate class for loop. So I will be explaining loop in detail and there you will be able to relate. So here we have ACC map. So here I'm writing put then ACC dot ID comma ACC. So this way what I am trying to do I am just storing ID as key and the whole account record as the value. Okay, so this way without like using loop, you can convert a list into map. Right. And here you have a control like if you don't want ID as the key, you want something else. So you can control that that particular field you can pass as the key. But if you don't use loop, you just assign that directly in that case ID will also be will always become the key. Okay, so if you run it so it will show the same results. Okay, so later on like after the session you can just test it and every solution is available here. I just created separate method naming convention is available. So whenever you will be watching this recording again, you will not get any confusion. So it is without loop. It is with loop. Okay, and both the methods are for standard object. And those who like are watching the recording directly. So I think you are also comfortable with two different methods. Now here we have another requirement where everything is same. We just need to change the object that is position. Right. So what you need to do here instead of account, you will be using position underscore underscore c because it is a custom object. So everywhere, wherever account is available, you will be changing it. And accordingly, you can just change the names. So naming convention also matters a lot. So here also position, then it should be position map. Then here we need to pass position list. And then position map, position map and position map. So this way I just modified this method. Right. The same way you will also be able to modify it and you can use it. Right. So all the process is same only object is different and same you can apply here also. So this I leave up to you and I think you will be able to implement and test it. And everything is available in the exercise sheet. So all these methods you need to practice one by one as I explained and these two examples also you can implement. So this number two, you can implement by watching the recording and number three, just try to implement. Don't copy paste. Try to implement it from the beginning so that you can have enough confidence. So as a beginner, try to do less copy paste and try to write your code at your own so that you can remember whatever you are writing. Right. And whenever you become intermediate or expert, then you can just copy and paste because you know all the concepts. So I hope this makes sense. So this is the end of today's session. And if you don't have any questions, so you can just leave and just share the word with everybody so that they can also get benefited. I can see lots of people are still asking like, can we start this boot camp? How we can begin? So please share the word whoever want to have a job in Salesforce ecosystem. So this free boot camp will be helping them. So you can see I'm explaining each and everything in detail. So as a beginner, this boot camp is very much important. Okay, so now if you have any questions, just throw that in the chat. I'm going to answer each and every question one by one. Okay, so I'm taking questions like from Praveen. So if I miss any question by any chance, so just you can ask it again. So where to use lists, set and map. Is there any shortcut? No. So I think you can just go through all three sessions and you will be understanding where to use which. And later on, like when we'll be working with triggers, so you will be getting more clarity. Jana, yes, put all s object array and put all list both are same. As object arrays like list. So Shiv, like when we merge two maps, so value is actually overriding. When I just demoed it didn't override. But if you see it like implemented in your system, so the second map which we are merging with the first one. So if both are having common keys, so second one will be available in the first map. So first maps key will be overridden. So for showing them in the columns, we need to use loop, then only we will be able to see them in different column or not in different column in different lines only. Yes, so no map can contain duplicate values. Deras limit five means we are querying five records only. Ashok is asking in what situation we use to map in one method. So if you have two different data sets, then we will be using two maps. Shivam, I think you can check the constructor. I think we can copy through constructor. So if you have already created a map, and if you are creating one more map, so in that constructor, you can pass that like we pass the list asset DML operation, we can perform on list only. So SOQL and DML are for list only. Someone is asking, I'm taking five records limit into aces list from that. Can we put only three records into map? Yes, you can. So for that, you need to apply some conditional statement loop or if else. So with that, you will be able to. So Shiv Rao is asking, can we define value like put method as one comma green comma pink? So no, it won't work. You can pass only two parameters, one is key and one is value. Okay, Praveen is asking how to add inline in map in curly brackets. So this is a good question. So let me just try it out. So I think this way, we will be able to do this. Let me just save it. No, it is showing error. So I just need to know the syntax. So let's search for the map and ethics. So for inline, I just need to see the syntax. I don't remember it exactly right now. Okay, so there is no example for inline. Let me just search. So inline map and ethics. Yep. So yeah, this this way, actually, you need to apply this, right? So I hope you get an idea. And generally, we don't prefer this approach because we will be working on the we'll be working on the s object mostly, right? So you can have that approach. So it is like string. Okay, so what we can do. So I think this way it will work. Yep. So this way it will be working one and then equals to arrow and then value. So if your key is integer, so you can just directly type it if it is string, you can type it in single quotes, right? And if you have multiple values, you can just put a comma in between. So I'm just checking more questions. Those are available in the chat. So I think few I already answered. Sanjit is asking is map having index so answer will be no. Yes, there is I will be teaching LWC. I know the visual force space I won't be covering. So Shubham, there is contains key method, I guess. So we use contains key which checks whether particular key is available in the map or not. So Sonu, we didn't use add method because add method can add only one value at a time. And through this key set and values, we are able to add all the keys and values. Sanjit, I never created object through apex. So I'm not sure I think no. So Praveen, I think I already demoed how to use curly brackets to initialize. Thank you, Asit for appreciating. And I'm happy like my efforts are helping you. Yes, Nagarjun, we can use this way like key can be account and value can be let's say list of contact something like that. So Prashant contains key basically checks whether particular key is available in the map or not. Or key set basically returns all the keys together. Thank you, Anand for appreciating the efforts. Sanjit, I am not sure I never created as object through apex. So just research about that. And let me know in the telegram group if we can, because I don't think it is possible. So Jana, we will be Jana Jyoti Jyotir, we will be understanding the uses together. So right now in different sessions, I just explain the use of list set and map. So like soon you will be understanding where to use list, where to use set, where to use map. So Pankaj trailheads are available in that session tracker. If you see the session tracker, there is a tab which is trailhead. So there are some apex related trailheads are available. You can just practice. Okay, so someone is asking for Mike and screen. Yeah, I will take care. I'm speaking loud. I think voice is clear. So we'll keep this in mind. And I'm using a zoom feature. So I just zoom whenever like whenever you see screen is blurred. So just let me know so that so that I can zoom in more. So no, this is not possible. We cannot have keys basis on the value because values can be duplicate. So it is not possible. Yes, Sanjit, we have contains key. So we can check keys, not values. Thank you, Vikash. Thank you, Gobi Krish. Thank you, Pranav. Okay, so Einstein GPT. I can't say anything as of now, because I don't see any impact as of now. So if it will be having an impact, so you will automatically experience that. Okay, so our component module is removed by Salesforce because new lightning web component framework is available. That's why aura is not used these days. So whenever upgraded framework is available, so previous one is of no use. So lightning web component is very easy to use. That's why. Thank you, punkers. Thank you, Sonu, for appreciating my efforts. I'm keeping this bootcamp simple so that everybody can understand. Ashok, yeah, visual force pages are basically related to classic only, and it is not used much. So you can just have brief knowledge through trailhead. So I won't be covering visual force in this bootcamp. Okay, so there's one more question initially, like, yeah, soon, like, right now, we are using aura as well, along with LWC. So like it is not known when it will be erased or removed or deprecated. So it is available. So we will discuss aura and LWC in the sessions. Okay, thank you, everyone. See you tomorrow with a new topic.