Remove Special ID item of Dynamic component list

The item no longer exists in the database when I show the new response it is empty and there is no data, so the item should not be showing, the problem in particular the remove id dynamic component block continues to show it as if it existed, yes I remove the “remove id Dynamic component” block, it works fine but with an “expected got ID 20” error, 20 being the id of the item that no longer exists… I simply need the item not to be displayed because it no longer exists but “remove component ID” deletes it but immediately shows it again… Always saving my life RSG, thanks and success

This block is exactly the cause of the problem. Que tendría que bloques serian los siguientes?

May be your are removing the I’d but not from the global variable it seems. If it is reprinting immediately then you must check up which global variable and having the data’s from those also you are removing it or not.

If you are removing from from dB then recall the data’s after removing

1 Like

Greetings GSR, thanks for responding friend, and I hope you are well and have success…

blocks(33)

en 1.- after getting the id of the item, send the variable and delete the item successfully
en 2.- session_id queries the database after the item is deleted

If I have more items, everything works perfectly, the problem is in deleting the last item that remains to leave the list empty, that’s where I get the error, that it doesn’t update.

3 items …

2 items, the deletion works very well.
only the last item that remains is the one that gives the problem that it is not deleted or updated

edit: the problem is not database, the problem is sampling

Show us the blocks, how do you create the Dyna compo. On clicking the item why do you clear the tag? Actually it seems every time you are wiping the tinydb. If so then what is the use of tinydb?

If there are only one item then you can clear the tag else clear the index of the item to clear from this tag

Hi RSG…

tiny db “cart_cant” only resets the counter in the upper red bar every time I delete an item that is just its function and as it is also shown in the previous screen I also have to refresh it in the previous screen…

blocks(38)

“If there are only one item then you can clear the tag else clear the index of the item to clear from this tag”

response: I suspect that the error is in what you say, but I am not able to build the solution, I just don’t know how to do it, I’m sorry…

Edit new information: I was reviewing the code, I broke it down and put it together little by little and I realized that when the last item is deleted the data is not updated no matter how many times you touch the button the item is already deleted but Web1 Got Text I don’t know updates and therefore the value that no longer exists is always being shown… now you ask me, how do I remove it?

Greetings koders friends, I come for a simple help but I’ve already done my tests and I can’t find the solution…
I have a dynamic component that makes me a list, I want to delete the last element and leave the list empty but it is not possible. when deleting the last item from the database, the api has nothing to send because it is empty, and therefore web1 response content does not receive anything and cannot update the last field to delete it (clarifying that the data is sent by JSON ). I want to be able to force json to receive empty data and not show anything and leave the list empty… Why do I want the list empty? Because it is a list of orders, and if the user wants to delete everything and make a new order, I can do it again after I add the items I can delete them too.

I get this error which is logical

Aguien puede orientarme que debo hacer para arreglar este problema?

Muchas gracias a Todos!!!

What about providing a screenshot of your relevant blocks?

Which database are you talking about?
Well, you like to delete the last item, so before deleting that item it still is there, isn’t it?

Taifun

Greetings Taifun, it’s correct, but after disassembling and assembling the blocks so much, I realized that the error is there that Web1 get response content receives the empty list and if there is nothing it does not show anything without error, that is the solution. I tried to send some defined values ​​from my api and they did not arrive, this error has me without hair, I want to solve it to continue…

here are all the blocks I shared



blocks(38)

I now merged the 2 threads
Taifun
.

1 Like

Sorry I’m not one to be in communities, I just read everything they publish and I follow the tutorials and what they share and from there I look for my answers and move forward, sorry if I came back a disaster writing in several parts it seemed to me that they had to do with me subject and how they are separated, thanks for correcting it for me… I’m sorry, what a pity…

How does the response content look like after deleting the last item?
The error then seems to come from the ParseJson method…
What about adding an if statement before calling that method?

Taifun

As my api does not send anything because it no longer has an item because it was previously deleted, parse json does not update anything and shows the last remaining item…
I tried to do this from the api to receive some other value to leave it there when there is nothing in the item but it doesn’t work. and it is correct the ParseJson method indicates that it does not receive arguments, so how to tell ParseJson that it does not matter if it is empty does not show anything so that the change is definitely empty



Unfortunately you did not answer my question

To find it out, display it in a label

Taifun

when there is still 1 item

this is all that happens after deleting the last item
after this I refresh the screen and everything is deleted

here add create empty dictionnary. also imagine the last situation, there is only one item is there and you are deleting if so what will be the length of the json and what you will store it in tinydb?

1 Like

Hi RSG.

if for example, there is an index left and it is 1 and it eliminates it, it remains at 0 or empty null, and this is what it should show or not cause an error at least show 0

cart_cant is a label to display the number of items next to the shopping cart in the top red bar of the app

i feel here is the problem…
image

so when the length is not equal to zero you should make this field to trigger. so when the web got text try to use one if then else

If call JSONTools1. Get CurrentArrayLength is not equal to zero
then
image

Else throw notifier, the list is empty

I keep getting the Runtime Error Argument must be valid JSON because ParseJson still doesn’t receive anything, I think the solution is to put the response in a variable, do something with that variable and have ParseJson look in that already modified variable to avoid getting an error

do one thing, On delete label try to catch the response in a label Dot add the parse json string and the call lists_detalle procedure simple use set label text to to response content