An index is arbitrarily inherited by different objects

What are you trying to do? (please be as specific as possible and include relevant screenshots, code snippets, and reproduction steps)

I want to add two buttons ‘Link’ and ‘Unlink’ which will allow users to establish or break a link between two entities in two separate DB tables. Because the entities are either connected or not, I want to hide one of the buttons based on the results of a query.

Note: I have selected to build separate buttons over two variants of the same component because they will run completely different interactions - one will create a new row, the other will find existing rows and update the value in column ‘status’

I was able to connect one button and have it perform well. However, I am having a problem with the second one. For some reason, it refuses to list the index ‘Mos’ defined by the element it is nested in alongside the first button.

The first button has the index I can use in code

The second doesn’t even though they are located within the same component:(

What have you tried so far? (please link relevant docs and other forum posts)

I have tried adding a prop to the Button two manually but there is no type Data available in the drop down

Relevant links:
my project Plasmic

Type Object is actually what you are looking for here.
Try creating the prop with Object type. When you open the modal again, the type should appear as “Data” (I can see how this can be confusing and will create a request to fix this ambiguity)

Alternatively, you can duplicate the Link C to H component, rename it to Unlink C-H and customize it to do the unlinking.

Thank you @sarah_ahmed.

The solution that ended up working:

  1. Add prop of type ‘object’ → it will be empty by default
  2. To populate prop with actual values: on the component’s settings screen add the necessary dynamic value → The prop will start taking in values

Alternatively, you can duplicate the Link C to H component, rename it to Unlink C-H and customize it to do the unlinking.

Btw, this suggested solution doesn’t work in my case because the original object and the copied one will share interactions (editing one will always propagate to another). So I won’t be able to define different interactions onClick for these two buttons. I could of course play with conditional step executions to make sure that some steps are skipped based on some variable, but that would defeat the purpose of having two separate buttons in the first place.