# Need to display a document download url and the author as well

**URL:** <https://community.ofelia.com/t/need-to-display-a-document-download-url-and-the-author-as-well/7763>\
**Category:** Q&A\
**Created:** [12 September 2016 09:08 UTC](https://community.ofelia.com/t/need-to-display-a-document-download-url-and-the-author-as-well/7763 "2016-09-12T09:08:39Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Dibyajit.Roy](https://avatars.discourse-cdn.com/v4/letter/d/7ea924/32.png) [@Dibyajit.Roy](https://community.ofelia.com/u/Dibyajit.Roy)\
**Post date:** [12 September 2016 09:08 UTC](https://community.ofelia.com/t/need-to-display-a-document-download-url-and-the-author-as-well/7763/1 "2016-09-12T09:08:39Z")

</div>

Hi  
I am using Bonita Subscription 7.1.2 .  
I have a task where multiple approvers will review a task and attach a document each.  
The requestor will be able to see the final status after all review is complete.  
The requestor should be able to see the documents that the approvers have attached.  
I was able to do that , but currently there is a list of all document url/links available.  
To make more sense out of it, I need to display the approver name beside the document so that the requestor is able to identify which approver has attached which document.  
As I can see , the Document\_ref variable has a field called author which returns the author id .  
How can we fetch the username based on the author id inside the designer page ?  
Also if we need to use groovy script in the operation section to fetch the username , then what flow should we use so that we get both the document name and document author name in a process variable and show it in the requestor page alligned to the correct document download link ?

---

<div class="post-metadata">

**Author:** ![Sean\_McP](https://dub1.discourse-cdn.com/flex013/user_avatar/community.ofelia.com/sean_mcp/32/932_2.png) [@Sean\_McP](https://community.ofelia.com/u/Sean_McP)\
**Post date:** [12 September 2016 10:30 UTC](https://community.ofelia.com/t/need-to-display-a-document-download-url-and-the-author-as-well/7763/2 "2016-09-12T10:30:03Z")

</div>

What? 🙂

Easier to write this down as a sequence, 1. 2. 3.

I would also be very careful about using the term Author, as there is no concept of Author in Bonitasoft. There is an Uploader (Submitter) and that would be the person doing the upload.

The SubmitterId can be used to read the organization and get the users name. This is quite easy and documented in JavaDoc and elsewhere on the forum.

As for “(how to) show it in the requester page aligned to the correct document download link ?”

Simple - Use a repeating Table. See here for example: [http://documentation.bonitasoft.com/?page=repeat-a-container-for-a-collection-of-data](http://documentation.bonitasoft.com/?page=repeat-a-container-for-a-collection-of-data)

regards  
Seán

_PS: As this reply answers your question, please mark as resolved by ticking the tick mark on the left of this reply._

---

<div class="post-metadata">

**Author:** ![Dibyajit.Roy](https://avatars.discourse-cdn.com/v4/letter/d/7ea924/32.png) [@Dibyajit.Roy](https://community.ofelia.com/u/Dibyajit.Roy)\
**Post date:** [12 September 2016 10:39 UTC](https://community.ofelia.com/t/need-to-display-a-document-download-url-and-the-author-as-well/7763/3 "2016-09-12T10:39:57Z")

</div>

Hi Sean

Thanks for your reply.  
I am familiar with the Concept of Using a container → setting the value as my collection → using $item for each item from the container.  
I have done the above. I get all the documents from the Document list.  
But I am not sure how to fetch the username for each document .  
By Using {{$item.author}} in a text field , i can fetch the submitter id . But how do I fetch the username in that text area or text field .  
Alternatievely I need to add a operation in the previous task, capture both username and user id and store them in a process variable.  
Now How do i match the values of the process variable and that of the $item since its a collection.

Any feedback is much appreciated.  
Thanks

---

<div class="post-metadata">

**Author:** ![Sean\_McP](https://dub1.discourse-cdn.com/flex013/user_avatar/community.ofelia.com/sean_mcp/32/932_2.png) [@Sean\_McP](https://community.ofelia.com/u/Sean_McP)\
**Post date:** [13 September 2016 10:36 UTC](https://community.ofelia.com/t/need-to-display-a-document-download-url-and-the-author-as-well/7763/4 "2016-09-13T10:36:23Z")

</div>

Personally we do this the easy way.

We do everything beforehand (in a previous service task) and create a HTML table which has columns:

Document : Submitter : Date

and display this in a text field.

Doing this allows you also to have Document Links etc. accordingly.

We do not use the container as it doesn’t always meet our need.

Note: when using HTML like this you will need to create your own Custom Widget as follows:

**Template:**

`

`

Controller:

`
function ($scope, $sce) {
    $scope.thisCanBeusedInsideNgBindHtml = $sce.trustAsHtml($scope.properties.testHTML);
    /**$scope.thisCanBeusedInsideNgBindHtml = $sce.trustAsHtml("this text will be OK");
    */
}
`

Properties:

`
testHTML
Label: testHTML
Treat as Dynamic value
Type: text
Default value: No data found
`

The Property can be linked to a form variable that is loaded by the form.

**NOTE:** _the use of_ **$sce** _should be done with care as it bypasses all Angular’s security mechanisms for injecting HTML to a form. You must be sure of the HTML code you are going generate when using it._

regards  
Seán
