Can't set state on reusable element

My reusable element is in a repeating group and i’m trying to capture the current time into a state. On the reusable element “page is loaded” workflow i’m setting the state but the state just isn’t picking it up, am i doing something wrong?

You cannot access elements in a repeating group from outside the repeating group. so for example on page load would not work. On your ReUseable element page add the page is loaded workflow there. Not where you are using the element but on its own page’s definition.

@reeceb

When the reusable is clicked in the RG row … send a url parameter to the page. Have a group monitoring that parameter. Have an event do when true monitoring that group. :wink:

Sorry, i updated my original post. I had already added it to the reusable element “page is loaded” and it wasn’t working. I’m also not trying to access any other elements, just trying to keep it all on the same element and do the states there.

I need it on the initial page load as i am checking against current time.

Anyone know what the issue is with this?

as it says in the fucking manual: states are communicated through the outer container. RTFM.

1 Like

Wow keithy, are you ok?
I’ve tried the outer containers on the reusable element as well as on the page and it still isn’t working.

There’s a plugin called relative time or something like that - pop that in your RE and compare to the plugin’s relative time instead of current time. That way it’ll always be up to date regardless of when page was loaded :slight_smile:

1 Like

Thanks for the suggestion.
To give further context, i’m checking if each venue is open by comparing open times to the current time. How efficient is the plugin as there could be many venues on the screen at a time (user defined), would it not be more efficient to make this calculation just once as opposed to every second?

Get the plugin and see. The plugin does all the heavy lifting for you - you just have to reference the state in your expression instead of current date/time.

1 Like

Gave it a go but after getting the relative time’s value it does not allow you to extract the hour or minutes. I need to extract the hour and * 60 to get the minutes for it to work.
Appreciate the suggestion though

I think @equibodyapp is talking about the ‘Current Date/Time’ plugin by Mintflow… Current date/time Plugin | Bubble

This plugin gives you access to the current time, in real-time, by updating every second (of course it’s easy enough to do the same thing without a plugin, but the plugin is quick and easy to use - just drop it onto the page/RE and refer to it’s time instead of the regular current date/time).

1 Like

Actually it’s this one I use Current realtime (date/time) Plugin | Bubble

But I’m sure Mintflow’s one would do the trick as well if it updates the current time without page needing to be reloaded.

Apologies I thought it was the relative time one, but just looked and this is the plugin I use to reference current time and compare to another time.

1 Like

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