It's all about the answers!

Ask a question

DNG > RPE - Sort Artifacts by Custom Attribute

Glyn Costello (13635) | asked Oct 22 '21, 7:02 a.m.

 Is there a clever way I can sort artifacts in a datasource by a custom attribute for publishing?

i.e. is there a way, using javascript, I can capture all the data I want to publish upfront in some sort of an array then sort it, save it to an RPE variable and then iterate through them for publishing? What limitations am I likely to face if I'm publishing many (>1000) artifacts?

3 answers

permanent link
Subramanya Prasad Pilar (4.6k14) | answered Oct 22 '21, 8:35 a.m.

Theoretically there is no limitation. You can also think of storing only the artifact URLs (sorted on their custom attribute value) in an array and for each element in that array do a data request (data source configuration within an Iteration element). If you are concerned about document generation time, reporting on Views would be better.

permanent link
Bartosz Chrabski (3.4k12648) | answered Oct 22 '21, 7:16 a.m.

 Hi Glyn,

If You use a DNG view as a data source then you can sort the data in the view. This way you will get sorted data in XML that you get through reportable API.

permanent link
Glyn Costello (13635) | answered Oct 26 '21, 12:33 p.m.
edited Oct 26 '21, 12:36 p.m.

 Looks like there is actually a detailed description of how this can be achieved here:

thank you for your responses. 

Bartosz Chrabski commented Oct 26 '21, 1:20 p.m. | edited Oct 26 '21, 1:23 p.m.


To get those information you need to use the view with this attribute or get attribute for every object. You can later add those elements to array according to the provided article and sort it using array sort function.

Be aware that if You are already using the view it is more efficient to do it in the view than in the report if You have large number of artifacts.

Both methods will work but concert is report generation time when having larger workload of data.

Your answer

Register or to post your answer.