0

How to pass List data type from LWC @wire method to Custom Aura Method

1
  • To Apex or to another Aura controller? Your question is unclear. What have you tried so far, post some code. Commented Apr 30, 2020 at 7:29

2 Answers 2

0

You can do it by making an array of required datatype:

If your data type is of primitive type than push that directly into the array, or

If your data type is an object or subject, create a javascript object by making use of {}, add the key values corresponding to the object structure, and push the same in the array.

At last, leverage the same array to pass it to the apex controller method.

Sign up to request clarification or add additional context in comments.

Comments

0

Let say you have an Apex class as below

@AuraEnabled(cacheable=true)
public static Object processResponse(string recordId) { }

Below is the example wire statement to call the above method and passing the recordId.

@wire(processResponse, { recordId: '123123123' })
contact;

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.