01-27-2020 01:34 PM
I'm trying to use the document suggestion results to populate multiple UI fields after selection. The only value accessible post-selection is the document id. Is there a way to return a document object after selection, or is there an API call that can be used to pull the document details (metadata) post-selection? I'm also thinking I could do a rest call to pull the document details if there is not a better way of doing so within studio.
nuxeo-document-suggestion id="BU" role="widget" value="{{document.properties.AP_Invoice:Route_CD}}" label="BU" min-chars="1" on-value-changed="_getSuggestionDoc" enrichers="thumbnail" result-formatter="[[thumbnailFormatter]]" >
_getSuggestionDoc: function(e) {
alert(JSON.stringify(e.detail));
//_getThumbnailUrl: function(doc) {
// retu "/nuxeo/api/v1/id/" + doc.;
}
01-29-2020 02:27 PM
You can use a <nuxeo-resource id="someId"><nuxeo-resource/>
element to query the document with the document rest API endpoint for documents
https://doc.nuxeo.com/nxdoc/rest-api-endpoints/, simply pass the endpoint url to the path
property of the element.
Then you would have to handle the value change at the _getSuggestionDoc
function, when the id changes you would simply call this.$.someId.get().then( //do something)
. If you need additional document info you can always add document enrichers.
01-30-2020 10:02 AM
Thanks You ac !!!! I think this will work for this and tons of other use cases I'm working on! Much appreciated.
Find what you came for
We want to make your experience in Hyland Connect as valuable as possible, so we put together some helpful links.