function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
ganesh k 65ganesh k 65 

how to return two values from apex to lwc

mukesh guptamukesh gupta
Hi Ganesh, 

For your solution you need to use Wrapper class

if you need any assistanse, Please let me know!!

Kindly mark my solution as the best answer if it helps you.

Maciej Król 28Maciej Król 28
public String someMethod() {
   Map<String, String> result = new Map<String, String> {
      "value1" => "Something",
      "value2" => "Blah Blah"
   return JSON.serialize(result);

and in LWC just JSON.parse string returned from Apex