Todo list, how to edit a name using the UID

I am trying to parse a todo shopping list, where various members of the family can enter items they want to add to the list.

I found that someone for example added "Lemons " with a trailing space. Using this simple code.

action: todo.get_items
data: {}
target:
entity_id: todo.google_keep_shopping

but no matter how I try to parse the list to get the name of the item instead of returning "Lemons " i get “Lemons” without the trailing space

Hence I want to remove that space from the todo list but it wont let me update it as in my code it is always looking for “Lemons”

So my question is as I can also parse the UID how do I modify the summary/name of the item using the UID as a reference.

or alternatively

how do I parse the list, to retrieve the name with the space intact.

As an alternative that may or may not be helpful to you, Node Red will preserve the space at the end, allowing you to parse and edit with code.

In the end, I found an answer, you can use the UID and use that as the name of the item and then rename to clean off trailing spaces, appears to be working well. I can now say to google add shopping or a chore to a list and it syncs with HA. Next stop Alexa. lol

Very similar to another recent thread, read it and you’ll get several solutions: