How do you replace an item in a listview with a particular phrase the press of one button?

I am having trouble replacing a word in the list view with a different one, any ideas on how to do so? I want to replace a certain phrase with another.

What have you tried so far ? Post a screenshot of your blocks

I have no idea of what I'm doing with the "flip button"

Forgive me but I can not understand what exactly you are trying to achieve. As for the "flip button" try something like this


1 Like

So for example, If put A, B, C, D and then I press the flip button, I would want the list to then be replaced by something of my choice. In terms of my app, I want anything in the list named "Forward Left' to be replaced with "Forward Right"

Let me understand .. you have for example a list forward_left A,B,C,D and a list forward_right a,b,c,d so when flip button is pressed you want list view to change from A,B,C,D to a,b,c,d . Am I correct ?

Sorry this is hard to explain, I want to replace anything named "forward left" with "forward right" in the listview

Try this way

1 Like

Will try, thank you brodie

in case there are multiple items in the list with the same value this will not work, because the index in list block returns always the first occurence of the item
therefore you will have to use additionally a counter variable, which increments the index...


1 Like

How would I do that? Could you show me, please?


Would I add this code to the one dora_paz suggested? If not what would it look like?

Instead of for each item in list use for each number from 1 to lenght of list by 1

I'm still having trouble with this, for example, I put "forward" in the piece box and I put "back" in the replacement box. I copied and pasted this same thing but this time I put "back" in the piece box and then I put "forward" in the replacement box. There seems some kind of error.

Can you help me please

I see your logic error in your Flip button.
You call the procedure that changes all your Forwards to Backs,
then you call the procedure that changes all your Backs to Forwards.

It reminds me of the old magic trick joke where the person pretending to be a magician wraps his hand around a coin and announces he will transport the coin to his other hand magically. Then he announces he will transport it back to the original hand. (He has not opened either hand to the audience.) He opens his hands, and the coin is exactly where it was at the start of the trick.

What you need is the ELSE branch of the IF/THEN block, using just a single procedure instead of two procedures. In the new Flip procedure, you walk through all the indexes 1 to length of list, like you did in your other procedures. But at each index, you have this IF/THEN/ELSE test:

if item at index n = 'Forward' then
   replace it with 'Back"
ELSE if item at index n = 'Back' then
   replace it with 'Forward'


1 Like

Is it possible if u could show me using blocks, sorry I am new to this and am really confused haha

Please download and post each of those event block(s)/procedures here ...
(sample video)

There is quite alot is it alright if I just export the whole project?