If you use an OOTB document upload control that contains the "On upload complete" event, such as the "BPM File Dropzone" or "BPM File Uploader", you can add the following code to the event handler to obtain the docId:
// Note even if multiple documents are uploaded, each one returns their own 'On Upload Complete' message with a single docId per message
var parser = new DOMParser();
var xml = parser.parseFromString(message, "text/xml");
var docId = xml.getElementsByTagName("output")[0].textContent.trim();
Note that as the comment above says, if multiple documents are uploaded, each one will fire the event and the logic will run separately and be able to obtain each docId. Hope that snippet helps!
------------------------------
Don Williams
------------------------------
Original Message:
Sent: Thu December 16, 2021 11:41 AM
From: Rameshkumar Chandrasekar
Subject: BPM Document Upload
Team,
I have a requirement to upload CSV file and show it in UI table. My thought process to upload the document via OOTB document upload control to BPM Content store and Using Content Integration Palate Item retrieve the content Stream by passing in the document id.
Now the problem is to retrieve the document id. Any body knows the way to retrieve the BPM document id ?
Or any other work around to achieve this ?
------------------------------
Rameshkumar Chandrasekar
------------------------------