[SOLVED] How to change a list of Things?

Seeking some help with this task;

I have a window with 16 window panes, named A1, A2, B1, B2 etc.

My goal is to allow the user to click on one or more panes and then click a button on the page called ‘Open’, which will change the appearance of each of the selected panes.

I have the following setup:

  • Option Set: ‘List_of_Panes’ (A1, A2, B1, B2, etc.)
  • Custom State: selectedPane (type: list ‘List_of_Panes’)
  • Datatype: Window, with fields:
    • Pane Name (type: text)
    • Open Status (type: yes/no)

Here are the steps I have taken to achieve the goal;

  1. Create a button on the page and name it “Open”.
  2. Click on the “Open” button to open the workflow editor and “Make changes to a list of things”.
  3. In the “Things to change” field, choose the “Window” data type.
  4. In the “List to change” field … [here is where I am stuck]

Does anyone know how I should proceed?

What exactly are you trying to do?

A window can have open or closed panes. The user must be able to choose which are open or closed. Open window panes look different to closed so I need to show one image for closed and one for open.

Importantly, the user should be able to select multiple panes and open or close them with a single click.

** I am going to set up a dummy app with very simple images to illustrate the issue

Do mean mean change the open/close status for each window with a single click?

Or do you mean first click on each window to add them to a list and then, upon another click, change the open/close status of all of the selected windows in one go?

This is what I mean… maybe I need another custom state called ‘change-status-now’. Then on each window pane I can add a condition to each pane which says When this pane [is added to selectedPane custom state] AND ‘change-status-now’ is YES, then make the changed. This may work actually!

Just create the list of windows to change (in a custom state or hidden RG), then make the changes to that list…

Ok thanks, I will give that a go.

Nothing works. To make this as simple as possible, how can I do this:

  • I have 3 yellow squares
  • User can select 1, 2 or 3 squares
  • User then clicks a button called ‘paint red’ and that colours all selected squares red

The issue I have is how to save this data to the database.

My current solution;

I have two custom states;

  • selectedSquare
  • colourAllSquaresRed

Then on the square element I have a condition which says to colour red only when it is both a selectedSquare AND the colourAllSquaresRed condition is “Yes”.

I don’t like that I have to save to the database the ‘selectedSquare’s’ because it feels wrong as they are no longer ‘selected’. I would rather save the red squares to a custom state called ‘redSquares’ but I don’t know how to :frowning:

Maybe I’m misunderstanding what you’re trying to do?.. (I don’t understand your two custom states)

But, as I said previously, I would just add the selected squares to a list, then make changes to that list.

i.e. when a yellow square is clicked, add it to the list (remove it if it’s clicked again).

Then make changes to that list when the Paint Red button is clicked.

like this:

Paint Squares (bubbleapps.io)

Is that not what you’re trying to do?

1 Like

That’s it, thanks @adamhholmes! I didn’t know about making changes to a list, I was (incorrectly) trying to change a custom state. I get frustrated with myself because I should know this stuff by now, but thank you for helping me.