Reusable popup for creating/editing a thing

Hello,

I’ve created a popup which users should be able to use to both create a thing and edit it.
The “editing” can also happen in different pages, therefore I decided to implement it as “reusable element”.

I’ve turned auto-binding on and, when I click on the “edit” button of a cell in a repeating group it awesomely populates all the inputs.
Unfortunately, when I click the “new” button… it still shows (and edits!) the previously clicked thing.

I’m clearly doing this wrong, but I’m not sure where I’m going wrong.

As for the workflows:

  • The “edit” one shows the popup, displays the current’s cell data
  • The “create” one shows the popup and creates a new Thing

I’ve also tried “resetting all relevant inputs”, no dice.

Anyone knows best?

If you are using “State” values, it will be there unless cleared…

Actually, I’m not. I’ll have to look into it.

I’ve added a boolean custom state to the popup (isEditMode) which I can set in the workflows and I’ve verified by changing, for instance, the text of the buttons (Add vs Save).

However, it’s still unclear to me how I can use that state to “unbind” the data when isEditMode is “no”.

What am I missing?

Reset the group in this case. Element Actions > Reset Group (or something like that).

1 Like

“Reset input” does not work sometimes. Try “Reset data” and select the parent group of the input fields.