0

enter image description here

How to pass value for params and how can I use those values inside the function?

  • If you are asking about serializing an array then i can help you with param function in JQuery. – Thanveer Shah Jan 09 '19 at 07:27
  • Looks like you are talking about MarkLogic Transform functions. Am I correct, and is it used for MLCP or REST? I'm guessing REST, because of the 3rd param? – grtjn Jan 09 '19 at 14:43
  • Yes, transform functions for mlcp. – Deepan Chelliah Jan 10 '19 at 05:41
  • 1
    MLCP transforms have a different signature, and only accept a param called `transform_param`, which can be found in the context hash table. You can find some pointers about MLCP transforms here, though it doesn't go into detail about transform_param: https://stackoverflow.com/questions/48526818/using-transform-module-during-mlcp-ingestion-to-marklogic/48528568#48528568. There are links to docs that do though.. – grtjn Jan 10 '19 at 09:26
  • @grtjn can you post mlcp command with -transform_param? How to pass the values through -transform_param and how to retrieve those values in our JavaScript transformation modules. Is it possible to pass array of string through -transform-param? – Deepan Chelliah Jan 11 '19 at 07:11
  • 1
    Transform param is a single string, but you could encode a lot in one string. You could pass in a comma-separated string of array, and then tokenize the value inside the transform. You could also look into passing in a stringified json object, and parsing or unquoting that. This sections tells a little more, and provides some examples: https://docs.marklogic.com/guide/mlcp/import#id_81502 – grtjn Jan 11 '19 at 07:52
  • @grtjn I need to create one generic javascript function and pass two parameters, one is content and other one is some string. I know how to create custom javascript function. Now the problem is I dont know how to pass the parameter using PARAM. I should be able to call this function anywhere and pass the parameres. Tell me how to use PARAM,not the context. – Deepan Chelliah Jan 16 '19 at 07:06

0 Answers0