You need to sign in to do that
Don't have an account?
Parag Devghare
How to convert List<Object> into String.
Hi Trailblazers,
I have List<Object> and I would like to print the value as a String.
I tried something like this but not succeed:
List<Object> animals;
string resultAnimalName = string.valueOf(animals.get('name'));//this line is giving error
System.debug(resultAnimalName);
can you correct me if I had done anything wrong?
Thanks,
Parag Devghare
I have List<Object> and I would like to print the value as a String.
I tried something like this but not succeed:
List<Object> animals;
string resultAnimalName = string.valueOf(animals.get('name'));//this line is giving error
System.debug(resultAnimalName);
can you correct me if I had done anything wrong?
Thanks,
Parag Devghare
Hi Parag,
Please find the solution
If you find this solution is helpful for you please mark best answer
All Answers
Check out this post https://salesforce.stackexchange.com/questions/106567/how-to-convert-listobject-into-liststring that should help you get started.
Looks like you are doing trailheads. The below articles would come handy:
https://salesforce.stackexchange.com/questions/171161/create-an-apex-class-that-calls-a-rest-endpoint-and-write-a-test-class-trailhe
https://gist.github.com/mannharleen/2890d40f5cea62d058d62f7c16e39f73
https://developer.salesforce.com/forums/?id=906F0000000MIjRIAW
Hope this helps you. Please mark this answer as best so that others facing the same issue will find this information useful. Thank you
Hi Parag,
Please find the solution
If you find this solution is helpful for you please mark best answer
Also thanks to Malika for giving your input, that woranswers my qu.
Kind Regards,
Parag Devghare