Hello. In this video, you will learn about ACDI Reporting Postprocessing, what it is, and how you can use it. Let's try an example of a simple report based on data received from eDirectory snapshots.
This report will show data about users, and it will show if you need to do some actions due to a login expiration date coming close.
So, here you have one entity for users, some filters, and a list of result table attributes.
Let's check one of the user entities.
You can see that some attributes are in a human-readable format and some aren’t.
And if you want to change it, for example, transform the date string into a readable format, define or change the order of days, months, etc., or change values from numeric codes to descriptions and words, you need to use postprocessing.
For example, attribute loginExpirationTime stores the date in a date string informat—"yyyyMMddhhmmssZ”.
But what if you need to create a report that you will run, for example, on a weekly or monthly basis and which will show users whose login will expire in a preset time period, in the next week or next month? For this, postprocessing is at your disposal. Let's see how it works.
In Report Editor there is a tab called “Postprocessing” where you can add all your JavaScript functions which will be implemented to filter values or to values in the resulting report.
You are able to paste in the function “value,” which is a value of an attribute excel itself; “record” which is a full record in the JSON format, and “context,” the main context of an operation.
A field with the custom name “record” has been prepared beforehand for this video.
You can use any other name for additional attributes. Let's see what the record will look like. For this purpose, a function that will return a string with the record was created and added here.
Okay. To enable postprocessing, you need to select the function, enable postprocessing,
and if you want to put a full record as a function argument, the feature “Pass full record object to the postprocess function” must be enabled. Let's look at the report.
Here you have only seven objects matching the criteria from the query. Let’s run the report.
You see now what JSON with the entity objects looks like. It can help you in further creating postprocessing functions. You can also see that the login expiration time is in a raw format.
In order to add a separator between years, months, days, hours, and minutes, you need to create a custom postprocessing function. Right now, in this video, the one prepared beforehand will be used. The function requires only one argument “value” and works by transforming a string into a new format.
Let's implement this function. Save and run the report.
Here are the results. Now the date string is much more readable and nice-looking compared to what was previously.
Should you have any questions or require any assistance, please do not hesitate to contact us at any time swsupport.skypro@skypro.ch