Hi Everyone, I cannot make this one seemingly easy step to work and will be grateful for any help.
Have a RG with list of Articles. I want to click on an icon outside of the RG to show the RG’s current cell’s data in a popup.
Popup and RG have the same type of content “Article”. But when I try workflow to display data in popup, there is no option for current cell. I tried to put RG, popup in same group, the current cell content in a new group etc. Nothing works. Only way it works is when i put the icon inside the RG, then I can display current cell data in a popup, but I cannot put the icon inside the RG.
By current cell, I mean the current article visible in RG. I want to click the icon outside of RG to show a pop up and display the RG’s article that is visible. RG is 1x1 and will show one article at a given time until I go to next/previous article by arrows (not showing in the screenshot).
Why I want the icon to be outside of RG, I am using various filters and RG and if no article matches the filters then RG will be empty and design changes. Could be a workaround but ideally will have the icon outside.
Hi there, @Hello1… if I understand your post correctly, one way you could go is to use a custom state. If you set a custom state to the article that is visible in the repeating group at any given time (you could set it on page load and when the next/previous buttons are clicked), you should be able to send (as an action in the workflow when the icon is clicked) the custom state’s value to the popup as the data to display, and you would be good to go.
By current cell, I mean the current article visible in RG.
That’s not what Current Cell means, so you won’t/can’t use current cell for that (as you’ve discovered)…
The best way will be to follow @mikeloc’s advice and use a custom state to set/store the article in question, then refer to that in your Icon click workflow to display the data in the popup.
Alternatively, you could just use a regular group instead of a repeating group, then you can simply refer to that group’s data as the data to send to the popup.
Thanks @mikeloc@adamhholmes for the suggestion. Custom state works too. I am new to custom state and was wondering if you could provide a bit more info on how to implement this? I tried but didn’t manage to make it work: https://testapril.bubbleapps.io/version-test
When i try to set state there is no way to select the current cell article under value.
No, you can’t use Current Cell unless you’re running a workflow on an element inside the cell (otherwise there’s no such thing as current cell)…
So forget about Current Cell (that doesn’t apply here)…
Instead you need to match the data source of the RG to the value of the custom state, and then specify which item from the list it is you want to display in the popup.
Remember, an RG holds a ‘list’ of data (articles), but you’ll want to custom state to hold just 1 article, so you’ll need a way to know which item from the RG’s list it is currently showing.
That depends on what your RG datasource is in the first place… but you’ll probably need another custom state somewhere to hold the item number.
Then any time the Article that’s displayed in the RG changes, you’ll need to update the relevant custom state values.
Personally, I wouldn’t use a repeating group here at all (I think it confuses the issue and actually makes things more complicated - I’d just use a regular group, then just refer to that group’s datasource as the data to display in the popup) - but if you’re going to use a repeating group you’ll need a way of matching the item number from the list to the item number you want to show in the popup.
Yeah, my bad… I probably made it sound like the custom state suggestion was a slam dunk. While it can definitely be done, it is not the most straightforward way to go, as Adam pointed out. Heck, if it was me, I would likely do what was implied by the question in Adam’s initial response and just put the icon inside the repeating group, figure out the design, and move on with my life… but that’s just me.
Yeah, agree looks like the best way is to put the icon inside the RG and fix the design, which is much easier and faster. Thanks a lot to both of you guys for your suggestions and help.