Yes, I agree with Daniel Jeffrey, you have a talent for teaching. THANK YOU!! & don't change! In past life, I was an OO ABAP developer (yes it is object-oriented..yeah..i know). You are the equivalent of Thomas Jung @SAP! I hope SF scoops you up, if they haven't already!
Nice video! Thanks for posting it! @36:30 you said string parsing is enormous overhead. What if I just use String fieldValue = response.getBody().substringBetween( '"fieldName":"', '',' ); to get a single field?? Asssume I just need few fields from the JSON response, that would be a lot faster than using wrapper class and deserializing JSON, wouldn't it?
If it's a simple JSON object and you're only getting one or two fields from it, that's ok to do. Much more than that though and you'll start to see the performance degradation start to add up.
My json2apex output file looks different with the JSONParser method included in all methods, and each value includes the {get;set;}, some values include _Z, like "public Integer limit_Z {get;set;} // in json: limit" . This makes sense for my use case as I have system values in the json payload and would need a way to parse through this using JSONParser method. I'm wondering how do I initiate this JSONParser method when generating my wrapper class @CodingWithTheForce? Or if you were to include this in your example above how would you initiate that. I've included a sample of the wrapper class. Thanks very much, your videos have been super useful to develop my understanding of rest integration. public class JSON2Apex { public class Data { public String client_ref {get;set;} public Integer limit_Z {get;set;} // in json: limit public Data(JSONParser parser) { while (parser.nextToken() != System.JSONToken.END_OBJECT) { if (parser.getCurrentToken() == System.JSONToken.FIELD_NAME) { String text = parser.getText(); if (parser.nextToken() != System.JSONToken.VALUE_NULL) { if (text == 'client_ref') { client_ref = parser.getText(); } else if (text == 'limit') { limit_Z = parser.getIntegerValue(); } else { System.debug(LoggingLevel.WARN, 'Data consuming unrecognized property: '+text); consumeObject(parser); } } } } } }
could you possibly do a video explaining these wrapper classes in more detail? I'm having trouble figuring out how to access data that's nested in the wrapper class. it's silly but I'm practicing callouts by making a salesforce pokedex and getting the info from callouts to the pokeapi. I was able to get all the names of the pokemon by using this video. but when I go to the pokemon's individual page there are nested json objects and arrays. I think it would be really helpful if you did a couple of different callouts with nested and varied data. I'm fairly new to apex. parsing json is so much easier in javascript and python, lol.
Hello could you please do few more sessions on same wrapper class integration topic which is also known as Data transfer object it would be very much helpful.
Hey Pavan, yes! It will be a little while but as part of the Intro to Apex tutorial series I'm currently creating I will be creating some videos going over absolutely everything related to test classes! You can follow the playlist here: ua-cam.com/play/PL0wESsiWMBTrCT3kNGIT3HpWLG6SmVr2F.html
@@CodingWithTheForce Sure thanks a lot as I'm from Non- coding background ,I'm finding it difficult to analyse the problem and impliment the right solution..and your videos help me a lot in figuring out the issues.. Hope one day I also become a software developer as you are🙂
really good information , i learned this doing my official first integration some days ago , so i can tell this is really helpful.
Thanks man! I’m glad you liked it and I appreciate the feedback!
Nice work, Matt. This is a great explanation of wrapper class use and an introduction to json2apex.
Thank you man I really appreciate it!
Great video! Well organized and informative! You have a talent for teaching.
Perfect video again! I will have to watch the others too! Thanks!!
Good information, Matt! Much appreciated.
Yes, I agree with Daniel Jeffrey, you have a talent for teaching. THANK YOU!! & don't change! In past life, I was an OO ABAP developer (yes it is object-oriented..yeah..i know). You are the equivalent of Thomas Jung @SAP! I hope SF scoops you up, if they haven't already!
Thanks Matt for this informative Tutorial. I would like to know if you have made any videos for inbound integrations into salesforce? Thank you.
Nice video! Thanks for posting it!
@36:30 you said string parsing is enormous overhead.
What if I just use String fieldValue = response.getBody().substringBetween( '"fieldName":"', '',' ); to get a single field??
Asssume I just need few fields from the JSON response, that would be a lot faster than using wrapper class and deserializing JSON, wouldn't it?
If it's a simple JSON object and you're only getting one or two fields from it, that's ok to do. Much more than that though and you'll start to see the performance degradation start to add up.
Wow man! You really helped me alot!
Nice Class. Makes me feel a little less timid about approaching the integrations via Apex vs middleware
My json2apex output file looks different with the JSONParser method included in all methods, and each value includes the {get;set;}, some values include _Z, like "public Integer limit_Z {get;set;} // in json: limit" . This makes sense for my use case as I have system values in the json payload and would need a way to parse through this using JSONParser method. I'm wondering how do I initiate this JSONParser method when generating my wrapper class @CodingWithTheForce? Or if you were to include this in your example above how would you initiate that. I've included a sample of the wrapper class. Thanks very much, your videos have been super useful to develop my understanding of rest integration.
public class JSON2Apex {
public class Data {
public String client_ref {get;set;}
public Integer limit_Z {get;set;} // in json: limit
public Data(JSONParser parser) {
while (parser.nextToken() != System.JSONToken.END_OBJECT) {
if (parser.getCurrentToken() == System.JSONToken.FIELD_NAME) {
String text = parser.getText();
if (parser.nextToken() != System.JSONToken.VALUE_NULL) {
if (text == 'client_ref') {
client_ref = parser.getText();
} else if (text == 'limit') {
limit_Z = parser.getIntegerValue();
} else {
System.debug(LoggingLevel.WARN, 'Data consuming unrecognized property: '+text);
consumeObject(parser);
}
}
}
}
}
}
could you possibly do a video explaining these wrapper classes in more detail? I'm having trouble figuring out how to access data that's nested in the wrapper class. it's silly but I'm practicing callouts by making a salesforce pokedex and getting the info from callouts to the pokeapi. I was able to get all the names of the pokemon by using this video. but when I go to the pokemon's individual page there are nested json objects and arrays.
I think it would be really helpful if you did a couple of different callouts with nested and varied data. I'm fairly new to apex. parsing json is so much easier in javascript and python, lol.
also, I wanted to add that your videos have been super helpful.
Thank you for it
How to parse html with img from json you have and insert into salesforce object??? Could you please suggest.
3:30 point of this vdo
4:30 postman or use han
6:55 json etto apex class Han direct
Hello could you please do few more sessions on same wrapper class integration topic which is also known as Data transfer object it would be very much helpful.
Hi ,could you please make a detailed video on Test Class on every aspect??
Hey Pavan, yes! It will be a little while but as part of the Intro to Apex tutorial series I'm currently creating I will be creating some videos going over absolutely everything related to test classes! You can follow the playlist here: ua-cam.com/play/PL0wESsiWMBTrCT3kNGIT3HpWLG6SmVr2F.html
@@CodingWithTheForce Sure thanks a lot as I'm from Non- coding background ,I'm finding it difficult to analyse the problem and impliment the right solution..and your videos help me a lot in figuring out the issues..
Hope one day I also become a software developer as you are🙂
You should have picked a more difficult JSON data.