Copied to clipboard

Flag this post as spam?

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


  • Alexander Wagner 36 posts 186 karma points
    Nov 14, 2024 @ 11:44
    Alexander Wagner
    0

    UmbracoFormsRecordsIndex not updating index automatically when submissions are posted.

    This is for Umbraco 13.5.2 with Umbraco forms 13.2.3

    My client has a "apply for membership" form that's an Umbraco forms with a custom workflow that creates an unapproved member and sends an email to one of the editors so they can approve that member.

    That email contains a link with formId and recordId, kind of like so: https://www.site.com/approve-member/?formId=1d636c73-4518-4ad8-83ef-9c1e6833ab80&recordId=8037e72d-e4fc-46c3-b4bd-bf4c205e7580 and we fetch all the data and show it to the editor.

    The problem is that the examine index doesn't seem to update automatically whenever a new post is submitted and since we fetch via IRecordReaderService GetRecordsFromForm (that fetches records from index) the approve page (like the link above) will be blank since the recordid isn't in the index.

    Is this a bug perhaps? Right now we need to manually re-index UmbracoFormsRecordsIndex every now and then since our client hans't got admin rights and it's not ideal.

  • Afreed 54 posts 261 karma points
    Nov 14, 2024 @ 13:06
    Afreed
    100

    Hi Alexander,

    The Examine index should update automatically whenever a new post is submitted (not really sure about forms but on other actions it does). I am not sure if its alright to index each time as a post is made as well, but you can implement a custom handler for form submissions to re-index only the UmbracoFormsRecordsIndex. To achieve this, subscribe to the RecordSubmittedNotification event, which will allow for targeted re-indexing.

    You can use IIndexRebuilder.RebuildIndex("UmbracoFormsRecordsIndex") to update the index immediately upon form submission, ensuring the index stays current without the overhead of manually rebuilding every time a new post is added.

  • Alexander Wagner 36 posts 186 karma points
    Nov 14, 2024 @ 13:07
    Alexander Wagner
    0

    Hi Afreed

    Thank you! I'll check it out.

Please Sign in or register to post replies

Write your reply to:

Draft