Office Hours reschedule

Office Hours Reschedule

Hi all :waving_hand:,

Flo and I are away today, so Office Hours will be postponed this week.

If anyone was planning on bringing any questions, feel free to post them in this thread :slight_smile:

1 Like

Hi @Matthew_S , I was thinking of attending to ask about this supabase file loading issue. I posted it on the forum.

Hi @emdiemeric , I answered your thread, can you try to see if my solution helped you?

1 Like

Hi @Matthew_S !

Need help with component logic.

  1. I created repeating items with component inside
  2. I created a component variable that may be triggered externally
  3. I created a component worlflow that resets the variable

When I trigger the workflow externally it executes only in the first instance of the component (first item of the repeating items list)

How to reset all component variables inside all instances?

Here’s a video with demonstration: Resetting Data in Repeating Components: A Workflow Challenge | Loom

I tried to write a JS loop using my component UID and with
wwLib.getFrontDocument().querySelectorAll('[data-ww-uid="c7015eaf-a266-4fc5-9da9-1851353cf279"][class$="ww-flexbox__object"]');

By this I was able to fetch all intsances with ids.

But I couldn’t find a way to set a right context from those objects to execute context.component.methods.executeWorkflow

And as I found in old messages from @aurelie using object uids is not the right thing to do.

I would recommend using an ā€˜Initial value’ for this kind of dynamic repeating of inputs. You might need to adjust the current setup a bit, but it will make the resetting much more straightforward: https://screen.studio/share/RLpJX9hw?state=uploading

1 Like

big thanks for the quick response!

I should’ve shown you the whole idea. Sorry I didn’t do it right away.

One more attempt with my question, if you allow: Optimizing Filter Setup for Multiple Entities in My Model šŸ’” | Loom

What I want to achieve - I want to use a component variable binded to ā€œinitial valueā€ as a proxy just to always show the default option in a dropdown when it’s been resetted.

I can bind ā€œinit valueā€ to the filter schema JSON object (something like "schema.filter_type.current_filter.option[0]"), but this will lead to the facts that:

  1. It will require making sure that in each filter the first element is always the default option (ā€œoption[0]ā€). And this is doable, so it’s fine.

  2. It will add more complexity to the setup when I need to reset any dropdown to default option. By resetting component variable it’s pretty simple. By resetting the whole schema JSON object its much more complicated in terms of configuring right paths.

UPDATE:

  1. It will require making sure that in each filter the first element is always the default option (ā€œoption[0]ā€). And this is doable, so it’s fine.

I tested it. This is not gonna work, because init value would be ā€œhardcodedā€ and wouldn’t change. So no reset will be applied.

Unfortunately the expected behaviour for using component actions on a repeating list of components is as you are experiencing – it will only execute on one of them. There isn’t yet the functionality to target an instance in a repeating list for component actions, so to handle this you would need to use features in the component configuration.

I think you get the gist of how you would need to set up the underlying data to support it, but just as an example: Arc — Screen Studio

1 Like

Thank you very much, Matthew!

I’ll do some workaround as you proposed.

Meanwhile I found this video https://www.youtube.com/watch?v=NL99k69Mo74&t=1189s
and it was pretty insightful :clap:

1 Like