Keep values synced

I’m trying to use a reusable element to manage the form for a database thing. That way I can build the fields and logic once and drop it onto pages rather than build a new form on each page. Seems like that’s what the reusable element is supposed to be for.

But the reusable element’s child elements aren’t available on the page, so I have to make a custom state corresponding to each child form element. Then I have to make a workflow action to force each custom state to update when it’s child element changes.

And I want to reusable element form to autofill whenever possible to prevent wasted time and mistakes. I can do that by setting initial conditions on the child elements…but “initial condition” doesn’t count as a change, so the element will have data in it but the corresponding custom state won’t have any data in it, which means the data in the reusable element’s child elements isn’t available on the page.

So if I use “do when condition true” and set run this to “every time” I can force the input element and the custom state that makes its value accessible to stay synced up. But I have to build a unique workflow for each form element.

Maybe instead we could just have a “keep this synced with that” function?

There are times when we have to keep two values synced because the data has to be stepped up or down through the hierarchy. It would be nice to have a one-click function which creates that relationship.

This is particularly annoying and error prone when it’s not a text or number. In order to get dates to sync I have to subtract them and set a “not 0” boolean because there’s no way to directly compare datetimes. Checkboxes are fun too because I have to convert them into text and compare to the text.

2 Likes

+1 on the idea. I also use this method and it feels really hacky. Thanks for the heads up about how to do it with dates.

Yes, a lot of work to build all of these workflows to keep everything in sync.