Pass dynamic data to JS function

Please check the following topics, this has already been discussed in our community: