Retrieving data from a rich text input

Hey folks, I’ve been making a little inline note editor that is contained within a tab on a page. The interface consists of a collection with some simple data shown - dates and long text.

See below:

The “Read only” toggle of the note is controlled by the edit / save buttons.

Now, behind the scenes I need to make it so that it updates the row in Supabase with the Save button. But when I try to populate the field, I can’t find the Rich Text’s data in the workflow builder:

I’ve got a couple of hunches:

  1. It’s something to do with the fact it’s nestled in a tab
  2. Since the rich text is in a collection, it’s unable to find the specific rich text input for the note I’m currently looking at.

I’ve banged my head against this for long enough and thought I’d ask for help here!

Hello, you need to use the workflow onChange on the inputs, then you can access the [event] value and work with that. In WeWeb when you repeat an element in a collection it loses the “state”, so you need to handle it manually

1 Like
1 Like

Thanks both, that’s really helpful - I’ll have a go at fixing it tomorrow!

I have not fixed it despite the great advice / tutorials. Here’s what I have:

Just to make sure I’m not doing something wrong with the actual structure, here’s the layout:

I have a variable that’s an object for storing the current changed Rich Text data within, as the changes happen. Now, within the workflow I can see the Rich Text input I’m trying to get data from

And from my understanding, what I need to do use that rich text input coupled with the currently selected note (eg something like “rich text - value [2]”) but as you can see it’s not loading any of the data.

Any suggestions? I feel like the solution is right in front of me :sweat_smile:

Ok, I got to the bottom of it - the trick I was missing in this tutorial was that the first screenshot was showing the “Path” setting for the variable update part of the workflow. It’s not something I’ve used before, so once that clicked it all made sense.