Unable to remove item from list

Hello , i was trying to code an instruction in which a message is received , it will remove the number from the list with these codes .


But the outcome says it is a bad argument to remove list item . What else can i do ?

Please provide a clear picture of the whole block
To get a clear picture of the block , right click on the block and select "Download Block as PNG"

This is the whole block for what i want to do

It would be great if you can tell what is "number" here
Is it the index of the list Item you want to remove?

No it is the number in the list . The number that wants to leave the list .


Hope this is clearer

That's where you are doing it wrong
In the index you need to write what is the index of the list item that has to be removed

Meaning the position ?

Yes
For example if I want to remove the 4th item of the list:

But that isnt what i am trying to do . Lets say for example , you are part of a broadcast list and you want to leave . All you have to do is write a code to that number and it will automatically remove you from the broadcast list . That is what i am trying to achieve. How can i do that ?

You will have to find the index of the the selected number in the list, then remove that item.

So the person cannot be removed automatic cally

If their number is in your list broadcastList and the request to "Leave" is made by that number, then the app should be able to do it...

But how ? The only way i thought to solve was with the remove list but its not working so what other way can my app be able to do such

  1. Does your app know the number of the person who wants to leave the list?
  2. Is that number in the list broadcastList?
  1. No
  2. Yes

So, how do they submit their message to leave (how does the app know who they are )? And is that information in the broadcast list ?

Let us try a bit of logic.....

The user of the app has a phone, yes? This phone will have a number, yes ?
The user of the app will either be ON the broadcast list or NOT on the broadcast list, yes?
If the user asks to leave, on their phone, then the app can capture the phone's NUMBER, yes ?
Now the app has the phone's NUMBER, it can check this against the numbers in the broadcast list, get the index for that entry, then use this index to remove that item from the list, yes ?

You may need this extension: https://puravidaapps.com/telephonymanager.php

1 Like

Maybe you can use this to get the Index
lists_position_in

When someone wants to join the list , they send a specific message text to the number through sms and automatically they join the broadcast list . What i am trying to do is opposite, a person in the broadcast list who wants to leave should send a specific message to the number and they automatically leave the broadcast list but i dont see how i can do such

But would it help me to get the position of the number automatically?