Why the Get Value For Key does not work properly?

Hi all, I am making an where I use Cloud DB, Dictionary, and ColinTreeListView.
Now my problem is when I tried to use the when ColinTreeListView1.ExtraButtonClick I used this block-


In the image you can notice that the ColinTreeListViewElement1 is returning "Item 1 5kg". And you can also notice that the global ItemDictionary also contains key "Item 1 5kg".
But the problem is, when I tried to get the value for key "Item 1 5kg" (ColinTreeListViewElement) from global ItemDictionary, it is returning {} instead of the original value.

Is that any problem with my code?
Thank you :slightly_smiling_face:

It works:

Having no access to your project, I can assume your dictionary has a dictionary structure but is not a dictionary.
Show block in which you download data to the dictionary.

Your key I believe is Item 1 5kg and not "Item 1 5kg", try to use replace block before call ColinTreeListViewElement.Text and see if it works

image

This is the whole block-

I still can't see where your data gets into the "ItemDictionary" variable.
You can do this test:

test

On the other hand, the fastest way to find the error is to put the aia file here.

Thank you @dora_paz and @Patryk_F for your help, I have solved the problem by debugging each and every blocks.

1 Like

Glad you solved it. In case someone else faces the same problem, what caused the error ?

Hi, it worked on companion but didn't work on the apk.
@ewpatton Can you please help?

How can help you without seeing your project. Nobody has a glass ball here. Put an aia here so we can see what you are doing wrong.

2 Likes

In this project
ATL_KV_EKM_Group_4_Prototype_Version3.aia (1.8 MB)
See the ItemCustomizer screen where you can see this block

Hello when I tried on different the result was different-
Working

  • Vivo Y21L (Version 5.1.1)

Not Working

  • Samsung Tab A (Version 10)
  • Xiomi Redmi (Version 8.1.0)

There is another surprising thing-
The screen initializes and the CloudDB returns the last saved items, when the extra button is clicked, it returns the details dictionary. But when a newly added item is clicked on the extra button, it does not return the details dictionary.

AIA on the above post. Thank you

Hi. Your application is very extensive. In order not to waste time learning about your application logic and figuring out what you meant, I built a simple Cloud database app. On my Samsung S8 with Android 9 it works with both companion and after compiled. Compile this application and test it on your devices.

The app saves items as a dictionary in CloudDB. Each item has a name, quantity and price. You can add items and remove.

cloud_dictionary.aia (4.3 KB)

Edit

I compiled your application and registered. I added two items to the store and after logging in again I can read the previously saved items without any problems.

I modified some of your blocks. There are no such errors.

ATL_KV_EKM_Group_4_Prototype_Version3_copy.aia (1.8 MB)

Thank you for your support, I will try it in my app.