I need to call external collector customize module in DHF 5.6.1. How can I do that? When I passed module in source query, it works but in main.sjs, I can only see 'uri' is coming within 'content' object. I can't see 'value' and 'context' within content object . Am I doing right or not? Is there a proper way to achieve it?
Asked
Active
Viewed 34 times
1 Answers
0
if you wish to see a 'value' and 'context' within the content object, those aren't returned out-of-the-box and should be configured in your main.sjs that is being referenced.
For example, this is one instance of the 'value' and 'context' can be configured and returned with your custom module (obviously it is generating a different use case but the concept should still apply)
function main(content, options) {
const inputDocument = content.value;
let additionalContent = [];
let myNodeList = inputDocument.getElementsByTagName("person");
if(myNodeList && myNodeList.length){
for(var i = 0; i < myNodeList.length; i++){
additionalContent.push({
uri: `/integration/analytics/${i}.json`,
value: myNodeList[i],
context: content.context
})
}
}
return additionalContent;
}
module.exports = {
main
};

Brian
- 1
-
Thanks Brian! Yes, I found that already in their data hub module's. You are right, in case of sourceQueryScript is true , it's not out of the box and it let user to customize in their own way. Nevertheless, Thanks for your response. – Manish May 13 '22 at 17:58