Scrolling in Repeating Groups to invalid entries

tl;dr In my app, users import data that I display in a RG. That data will likely contain validation errors (i.e. incorrect dates). I would like to create a button/workflow to scroll the user to any invalid data in the RG, so that they may fix it. Have not found the best way to do that.

Full Text

I’m creating a user import, allowing the user to upload data on an item (‘Employee’). To display that data, I have created a Repeating Group, with a series of inputs auto-binded to the ‘Employee’ Data.

In this repeating group, there are certain rules: for instance, Hire Date cannot be earlier than Birth Date.

I fully expect that users will upload this data and their upload WILL contain invalid entries. I was hoping I could create a button to scroll the user to the first invalid entry. This would allow them to fix it on the spot. As they fix, clicking the button would scroll them to the next bad entry until all are cleaned up.

I cannot think of a way to get the workflow to scroll to the ‘Employee’ record with invalid data without doing a bunch of filtering and "Do search for"s.

Does anyone have an idea how to create an efficient way to scroll to invalid data in a large Repeating Group?

Hi @brad.a.farley :slight_smile: One alternative to doing the searches each time that list of Employees is viewed, may be to store a second list of Employees which have the validation errors right after the data is imported (Then you only have to run the searches once in the beginning, and it may be a little easier to keep track of/work with). You can also use that list of Invalid Employees to have conditions such as “When the Invalid Employees list:count is not 0” --> show a popup which notifies the Current User that they still have records to fix.

After you have the list of all of the Employee records, and the list of the Invalid Employee records, it may be easier to have a filter option with the toggle being View: “All Employees (40)” or “Invalid Employees (10)”, to toggle and display the corresponding lists.

To keep everything in one list and scroll to the next Employee may require a custom state to keep track of which Employee the Current User was just scrolled to (type: number, list: no).

For example, if the Current User is viewing all of the Employees (valid and invalid), the first time the Current User clicks the “Scroll to Invalid Employee Record Button” would use the action “Scroll to entry: Invalid Employees list, item #(custom state value)”, with that first custom state number value being 1.

Then if the Current User edits that Employee record so it becomes valid, a workflow would need to run which removes that Employee Record from the Invalid Employees list, and the custom state would remain at 1. This is because the ‘next’ Invalid Employee would become first in the list again, and we don’t need to increment the custom state by 1 in this case.

Alternatively, if the Current User chooses not to edit that first Employee record and clicks the scroll button again, the scroll number custom state value would need to increase by 1 and become 2, so the action is “Scroll to entry: Invalid Employees list, item #(custom state value)”, with that value being 2 now. The Current User would then be scrolled to the second Employee that is within the Invalid Employees list of Employees.

A third workflow would also need to restart the custom state value at 1, if the scroll to next Invalid Employee button is clicked, and the Current User is currently viewing the last Invalid Employee record in the list.

There may be a less complicated solution, but I think that one would do the trick for scrolling :slight_smile: Feel free to let me know if you have any questions at all!

This topic was automatically closed after 70 days. New replies are no longer allowed.