Dynamically vertically resizing repeating group

Hi, I am making a forum and I have added the ability for users to post images along with their discussion posts. I have the images automatically hidden using custom states and they are shown once the user clicks on the icon below.


My issue is the once a user shows the image, upon changing the state back to hidden, the repeating group remains expanded unless I refresh the page.

Image show, repeating group expands vertically

Image hidden, repeating group does not collapse vertically.

1 Like

Hi, group your repeating group, set the group to collapse when hidden then swap the show/hide condition or workflow to the group.

1 Like

I grouped the entire repeating group and within that group I selected collapse when hidden however I did not have luck with that, unless I did it incorrectly.

Below is the image along with the conditional formatting I use to hide/show

I have the image set to adjust element height so it expands accordingly.

Hiding and showing a textbox seems to work properly with showing and hiding the element, no luck with images though

I thought the image was a repeating group, could you try group the image to collapse/hide instead. Design just one cell of your discussions rg and make this cell the total height for when the image is visible, also set the height of the image to whatever the max you would like to be.

1 Like

That seemed to do the trick, I set the group to collapse and switched the conditional formatting from the image to the group containing the image

1 Like

@jcjags63 Would you mind explaining how you got the individual repeating group to expand vertically when that button is clicked? I am trying to implement a very similar feature where I have a vertical repeating group that shows a preview of set of data, but when you click a button, it expands vertically to show more information. So far, when I click the button to expand one of the rows in the repeating group, the height of every repeating group increases, even though only the details are shown for the repeating group row I clicked.

It’s been a while since I’ve looked at this but at first glance what I would do is set the image to collapse when hidden. Then I would set the parent div of that image to a min height of 0 but fit height to content. Then your toggle should show/hide the image which should scale the parent div to the height.

Let me know if that helps