I have datatable with a lot of different values from fields and I need to calculate and show these values in datatable. I have getters for now which call function. Is it possible to call this function from LWC component's HTML markup instead of call it from each getter?

  • 1
    Can you be more specific of what you're trying to achieve?
    – sfdcfox
    Commented Sep 28, 2020 at 13:51
  • @sfdcfox I just edited my question Commented Sep 28, 2020 at 14:34
  • 1
    You can call functions that exist in your JS file and tie events to your HTML markup, but I don't think that answers specifically what you're looking for. What data are you trying to get and when are you trying to get it?
    – nbrown
    Commented Sep 28, 2020 at 14:36
  • @nbrown I need to dynamically render text based on field value. So as sfdcfox said it's not possible to call method from markup and I should use getters Commented Sep 28, 2020 at 14:56

1 Answer 1


In your markup, you can only call getters and specify event handlers, which can only be triggered in response to an event. It is not possible to put functions directly in markup.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .