This discussion has been locked. The information referenced herein may be inaccurate due to age, software updates, or external references.
You can no longer post new replies to this discussion. If you have a similar question you can start a new discussion in this forum.

Need to know when a node was added to the DB

I would like to be able to display on the node details page the date that a node was added to the database. I examined the database tables and did not see where or if this data is retained. Is there any way to get this information, or is that information deleted after a certain point in time?

Thank you.

Parents
  • There is an event triggered when node is being created. You can see all events in dbo.Events table or via GUI in Message Centre. Here is an example how to get report on the recently created nodes

    To be able to display this on the node's page you would need convert this into SQL query and use filter like here

    Keep in mind that Events have retention period (configurable in settings) and will be deleted after that time. I don't know of any other permanent place where creation date is being recorded.

  • Thanks Alex. That is the direction I was thinking I would need to take. I also assumed that the node added event would be deleted after the event retention period had been reached. Therefore, I had the thought that I might set up an alert that would trigger when the audit event "node added" had occurred. The trigger action would then be to change the value of a custom property. But is there a way to insert a date/time stamp into a text type custom property that would then represent a permanent record of when a node was added?

Reply
  • Thanks Alex. That is the direction I was thinking I would need to take. I also assumed that the node added event would be deleted after the event retention period had been reached. Therefore, I had the thought that I might set up an alert that would trigger when the audit event "node added" had occurred. The trigger action would then be to change the value of a custom property. But is there a way to insert a date/time stamp into a text type custom property that would then represent a permanent record of when a node was added?

Children
  • Why do you want to have your date/time in text field? Is this because you already created text-based custom property? You can have date/time-based custom property as well and in latest NPM just simply use action trigger to trigger update of this custom property with current date upon node creation. I haven't done exactly that, but hope all is doable via alerting GUI

  • Did some more work with this and found that you must use text as the type for the custom property, so that you will be allowed to insert the datetime stamp in the CP field. This is not possible with the DateTime type of custom property since it only allows you to select an specific date and time rather than use the SQL variable ${DateTime}.

    Also, one must trigger the alert on Node in order to be able to configure trigger actions based on a node custom property (audit events do not have

    custom properties).


    Anyway, I got this to work finally. My alert triggers on the node property "node was created", and then triggers the action of updating the node custom property with the datetime stamp. Sweet!

  • Thanks Alex. The last little thing I am working on is to include the identity of the user who added the node in an alert email. I think this will have to be a custom SQL action, but I just have to work that out.

  • ok, this one is a bit more complicated but still doable. I did similar thing with Unmanaged report - basically I wanted to see on the node page when node has been unmanaged and by whom. The logic goes as follows:

    1. You report on the fact itself (node added, node unmanaged, etc). This is what you have done already

    2. You need to JOIN dbo.AuditingEvents table by joining node record with record for when this node has been created. AccountID column will be user you are looking for. I have published very similar solution for Unmanaged Nodes info - please check how SQL is constructed to extract user info and do the same here