Adding row from outside of repeater

Can anyone help me?
I’m trying to add rows to the repeater from outside (data from input fields and row numbers)
I was able to achieve the first part, however, I’m not able to create level indexing. I need this ‘index’ (or row number ) for deleting the parent and its child and/or adding more children under parent.add_rom_from_outside_of_repeater.rp (48.5 KB)

https://h5w3pc.axshare.com

It is not clear what your logic scheme is for “level” and “sub-level” and you haven’t defined it anywhere in your repeater structure. When you create a row with the Add Rows action, you can’t refer to data in that (yet non-existent) row (“item” in Axure Interactions syntax.) This is what you are trying to do when you set the “level” column data to [[Item.level]]

It is also not clear what you are trying to do when you update a row that you’ve just added …twice. Once for the “level” column and again for the “sub-level” column You can just set these values as needed when you create the row.

I’ve added a Page 2 to this updated file, showing how you can use the existing repeater data (number of rows/items) to increment a count or “index data” in a column. Hope this helps. If not, could you explain a little more about how you envision “level” and “sub-level” would work?

add_rom_from_outside_of_repeater.rp (59.2 KB)

I’ll try to explain more. Level items are for parents and sub-level for children.
The user starts with an empty page (repeater with no values).
The user can add at least one parent with at least one child (up to 100)
The user can delete a child (deleting the last child, deletes whole entry)
The user can delete the whole instance (parent and its children at one)
that is why I need a level to distinguish which parent can be deleted from outside the repeater. If there is a simple solution I would be more than happy to learn about it. Thank you for your current explanation. What you showed me works fine and it is/will be helpful but it doesn’t solve my problem. sorry that I wasn’t clear enough :slight_smile:
nevertheless thanks again for your help.
https://d6u2pf.axshare.comadd_rom_from_outside_of_repeater.rp (65.1 KB)

What I did now is to remove the sub-level column and I’ve tried to iterate parent and child as follows 1.0 (parent) 1.1(child), 2.0 2.1 2.2… and so on. Also, I’ve made this rule which works perfectly fine within repeater but it doesn’t work from outside

[[ (TargetItem.level >= Item.level) && (TargetItem.level < (Item.level + 1)) ]]

I just found another issue… when I delete an item (i.e 3rd and 6th) and then I want to add a new item it re-creates deleted index
image

I think I should rethink the whole idea…

maybe I should evalute an item in repeater… i.e Item.level (parent) Item.level + 0.1 (child) and update row with Item.level + 1 however it still demands at least one row to exist in repeater. and I dont know how to get (configure) those from outside repeater. I can’t figure out how TargetItem works :):sweat_smile:

Maybe this thread can help you.

I found this thread yesterday. And this is almost exactly what I wanted… however all action should be performed from outside the repeater… I fought whole day… I read dozens of other thread and still I can’t figure out how to reach this data from outside :frowning:

thanks anyway :wink:

Edit_Custom_Tree.rp (229.9 KB)

I made this for a project a long time ago and I’ve forgotten most of what I did to get it all to work. (It is very complex. :smile:) But you might be able to reverse engineer something to fit what you’re looking for.

Thx. I did a quick look. It will be helpful. especially passing the value of variables. thanks mate :slight_smile: