Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • H. Polkerman 8 posts 109 karma points
    Nov 28, 2022 @ 14:06
    H. Polkerman
    0

    Umbraco Forms - List of all Forms

    I'm wanting to delete the entries from Umbraco Forms with the attachments that are 30 days or older, but cannot find any clear documentation on how I can get a list of all (not root/folder, but all existing) forms in Umbraco to iterate trough to get the records.

    My plan was to get all older records and delete them per form in a scheduled task. Anyone got an idea on how to get the complete form list in dotnetcore to use in an scheduled list?

  • Yakov Lebski 591 posts 2347 karma points
    Nov 28, 2022 @ 14:37
  • H. Polkerman 8 posts 109 karma points
    Nov 30, 2022 @ 08:29
    H. Polkerman
    0

    Hi Yakov,

    Thanks for the reply. I've seend the documentation allready and there is no option for getting all the forms back as objects, or how to delete them with attachments.

    The options given in the documentation are only usable if you know which pages your Forms are on (per pageid) or if you know the name/guid of the form it self (formguid/id).

    There is apparently no option in code/library to get all the forms back as a list. For GDPR the need is that all record data from all forms older then 30 days is deleted including attachments.

    I have seen older solutions to delete them straight from the database, but we would like to keep it in a schedular with logging instead of stored procedures and/or database deletion scripts.

  • H. Polkerman 8 posts 109 karma points
    Nov 30, 2022 @ 13:05
    H. Polkerman
    0

    Apparently the need to develop an scheduled task to remove records has been removed with the new functionalities that are added on the latest forms settings/config options:

    https://docs.umbraco.com/umbraco-forms/developer/configuration

    See the options: DaysToRetainSubmittedRecordsFor DaysToRetainApprovedRecordsFor

    I'm going to test out if these options also remove the attachments associated with the entries/records.

  • Yakov Lebski 591 posts 2347 karma points
    Nov 30, 2022 @ 14:18
    Yakov Lebski
    0

    Looks like a very useful feature

  • Yakov Lebski 591 posts 2347 karma points
    Nov 30, 2022 @ 15:12
    Yakov Lebski
    0

    Looks like it contains also a timer for the schedule

    "ScheduledRecordDeletion": {
        "Enabled": true,
        "FirstRunTime": "",
        "Period": "1.00:00:00"
      },
    
  • H. Polkerman 8 posts 109 karma points
    Dec 05, 2022 @ 09:10
    H. Polkerman
    100

    Yes, it seems it does need some extra settings though. I'm currently testing the solution.

    I haven't had succes yet with getting this to work locally, so I'm testing this on a cloud-server:

    Edit; It seems to work: The new version of Forms (10.2.x) can be set the appsettings. They are only applied new forms. The current ones need to be set in the newly added settings so you can configure per form how long the data needs to be saved.

    So no more support needed, all works now!

Please Sign in or register to post replies

Write your reply to:

Draft