Hello,
We're throwing around some different design ideas for a project and one of the ideas would require retrieving configuration data stored with the record from a Handlebars template. Thing XML template being saved to FTP server.
This configuration data is an array of essential key/value pair records, something like this:
{
"config": [{
"name": "supplierSKUId",
"value": "PW"
}, {
"name": "UOMQualifierID",
"value": "UOMQID"
}]
}
From our template, we'd like to do something like this:
<?xml version="1.0" encoding="UTF-8"?>
TransferOrder
{{timeStamp 'UTC'}}
{{find "config", "name", "UOMQualifierID", "value", ""}}
That would yield
UOMQID
The signature of the helper would be:
{{find , , , , [, ]}}
That signature is getting a bit long, perhaps the find() helper could return an object and could be used in conjunction with a helper like getValue but one that took an object reference as a parameter, something like this:
{{getValue (find "config", "name", "UOMQualifierID") "value"}}
I'm sure if I thought about this longer I could think of more use cases and maybe some overloads to support those use cases, but you get the idea (hopefully) from this example.
My question: Is there a way to do this now?
Follow up question: If not, can we work with you to create this helper?
Regards,
Steve