Copied to clipboard

Flag this post as spam?

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


  • Will Price 12 posts 94 karma points
    Sep 07, 2022 @ 02:35
    Will Price
    0

    GetRecordsFromForm not working with 10.1.1

    I'm trying to iterate through form data to display some statistics. The code was working last week but now returns no records.

    We are using GetRecordsFromForm:

    foreach (var rec in _recordReaderService.GetRecordsFromForm(Guid.Parse(myGuid), 1, 500).Items)
        { ... }
    

    We have just updated to Forms and Umbraco 10.1.1. Site seems to be working fine, but this issue is now occurring.

    The code is inside a Partial View which is referenced in a template.

    Partial view contains all the relevant references:

    @using Umbraco.Cms.Web.Common.PublishedModels
    @using ContentModels = Umbraco.Cms.Web.Common.PublishedModels
    @using Umbraco.Cms.Core.Models
    @using Umbraco.Cms.Core.Composing
    @using Umbraco.Forms.Core.Services
    @using Umbraco.Cms.Core.Security
    @using TPCFormsExtensions
    @inherits Umbraco.Cms.Web.Common.Views.UmbracoViewPage
    @inject IRecordReaderService _recordReaderService;
    @inject IMemberManager _memberManager;
    

    There are no log errors related to the page, it just shows zero records found.

    We can see all the form results in the backend fine. Completed the form again to add a new record in 10.1.1. and it shows in the Backend but still GetRecordsFromForm returns nothing.

    This is extremely important as the whole point of the site is using Forms to record data from members and display statistics on those records.

    Any ideas for what to do to fix this issue?

  • Will Price 12 posts 94 karma points
    Sep 07, 2022 @ 03:16
    Will Price
    0

    Actually, the new form I just entered is being returned.

    What would stop the other Records being available?

  • Heather Floyd 610 posts 1032 karma points MVP 6x c-trib
    Sep 15, 2022 @ 18:39
    Heather Floyd
    0

    Hi Will, I came across this issue today while upgrading a site from v7 to v10 - none of my existing Form Records were getting returned by the RecordReaderService, but if I added new form entries, those new ones were getting returned.

    I was able to solve the issue by updating the Examine index:

    1. Go to Settings (Main dashboard)
    2. Click on the "Examine Management" tab
    3. Click on "UmbracoFormsRecordsIndex"
    4. Scroll down to "Tools" and click the red "Rebuild index" button.

    enter image description here

  • Will Price 12 posts 94 karma points
    Sep 19, 2022 @ 04:40
    Will Price
    100

    Thank you for that advice Heather, it turned my particular issue was more than that.

    I spoke to the Forms team and it turned out to be a bug that occurred if fields have been changed in a Form that has already had submissions. It apparently was introduced in upgrading Forms from 9 to 10.

    After upgrading to UmbracoForms 10.1.2 (and I did Umbraco 10.2 too), and also rebuilding the Examine Index, the IRecordReaderService then returned all Form Recrods correctly again.

  • Heather Floyd 610 posts 1032 karma points MVP 6x c-trib
    Sep 19, 2022 @ 15:48
    Heather Floyd
    0

    Great! I'm glad you got it figured out, and a patch was released for anyone else with the same issue. 🙂

Please Sign in or register to post replies

Write your reply to:

Draft