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

https://www.sfdcpoint.com/salesforce/wrapper-class-in-lwc/

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

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

Thanks
Mukesh
Maciej Król 28Maciej Król 28
@AuraEnabled
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