[SOLVED] Saving inputs which are on a reusable

Hi guys,

I have a reusable element with a series of dropdown inputs. As I understand it, I need to put custom states on the top level of the reusable so that my main page can then refer to these states and save to the database, but how do I get the dropdown inputs into the custom states?

Maybe you know of a better way to save data to the database whilst using a reusable?

Thank you for any tips…!

Hi there, @darren.james7518… I’m thinking there might be more to this question than meets the eye, but getting the dropdown input values into the custom states should be as simple as using the An input’s value is changed workflow event.

When an input’s (i.e., one of the dropdown’s) value is changed, use that workflow event with an action in the event to set the appropriate custom state to the input’s value.

You could also use that workflow event to save the value directly to the database if you want. Or you could consider having a submit button in the reusable element and saving the dropdown values to the database when the button is clicked.

Hope this helps.

Best…
Mike

2 Likes

Thanks @mikeloc that did help, I am new to the world of reusables so just having some teething issues!

See the image below, that is a reusable. The blue buttons (rows/columns) store data to a custom state on that reusable - over on the main page I have a ‘Save’ button and in that workflow I can refer to those custom states. Example; Rows = abc_reusable’s _row’s_number

But, I can’t save the input to a custom state (shown with 600 inside) because it doesn’t have a workflow.

Screenshot 2022-10-14 205140

…so the ‘Save’ button workflow doesn’t know where the data is …

Use the exact workflow event I showed in the screenshot to save that input’s value to a custom state when the input’s value is changed. Then refer to the custom state’s value when creating a new window.

1 Like

Yes! That worked … thank you! Very grateful because that would have held me up all weekend!

1 Like

Ah … I had an issue which frustrated me (for hours) and as soon as I gave up and posted the question here I found the answer - that seems to happen often actually!