List modification issue

I’m stuck on this piece of code that I’ve written:


I’ve debugged each variable and it’s correct it just doesn’t replace the item in the list, the ID is correct, the new JSON object value is correct and the JSON List array is correct too

Project available on request

  1. You use global variables when working with objects - to me it is not pleasant. The fact that the blocks of global variables become unstable and instead I recommend using parameters of variables of the function.

  2. Do you believe that a new option is added to the list?

  3. Loop through the list of objects in a stored - not a good idea.