Weird challenge - repeat group results re-ordering when resubmitting same data

Hey guys,

So, we have a repeat group - on this repeat group we have a button which allows the user to reveal more information on that record.

The way we know which record should show/hide the information is that we parse the unique ids through a db query, with a form submit again.

So;
Form inputs create the search
Form submit queries external API
We group the uids from the API and check against DB
We return the results to the user with each record either showing/not showing certain data.

Works great.

If a user clicks the ‘reveal’ button on a record in the repeat this is the flow:

SC action inputs the unique ID of the record into the DB we query against.
Rerun the form with the same inputs so we can parse the data back through the DB query.
The record should now ‘display’ the new data they revealed.

The problem I have is that one of two things then happen:

  1. The record actually dissappears for some reason from the search, if I manually resubmit the form then it appears again.
  2. The results move a little, so the user might need to scroll up or down to find the record.

Both are pretty poor UX.

The repeat does have a unique key which is the same as the unique id we use.

Does anyone have any suggestions on how to tackle this? Ideally there would be a way to show/hide on that record without having to resubmit the form and the full query - but I don’t think that’s possible.

Not sure how big the data is, but couldn’t you just pull all the relevant data in the initial data call? So that way when they show/hide more info, it’s not making another data request?

Often I tend even seemingly big queries are only a few Kbs over the network.

Hey @Philip_J,

We are purposely not sending data to the front end, as even if we show/hide on the FE, that data is still available in the console. We aren’t restricting data due to size, but more-so due to this being part of our monetization.

Roger that :+1:

1 Like

Hey @Teodor can I borrow your expertise for this one? Any ideas what I can do?

Hey @Teodor little bump my friend. Currently I submit the data via a form (Direct) - I wonder if doing this entirely via a server connect would avoid the wierd issues with the repeat group happening? Can you suggest anything I can try?

  1. How do you mean disappears, does it just disappear out of the DOM or also from the results?
  2. This is probably because of a DOM update, perhaps you could show in a short movie how much it affects you.

Thanks @patrick

The result dissappears from the repeat group results, as well as the DOM.

I've sent a short video to you privately (because it contains private information). You can see in this video we reveal contact info for 3 records, the final one completely dissappears from the results.