CloudDB question

I agree.. it IS a logic issue. I am looking, and have looked. Its probably right there in front of me but I dont recognize it.

This isnt the first time this has happened to me.. but if I stare at it long enough I do eventually see it. I was just hoping that someone can rattle my brain enough to make me think at it a different way than I am now.

But to confirm.. this is not a CloudDB limitation, and what I am trying to do IS possible, yes?

Yes, of course :slight_smile:

New developments.. I did a little troubleshooting and I discovered that it app is not changing rooms for everyone .. they are still where they were. Its the ListView data that is changing for everyone. Its basically the same thing but the room changing routine works as designed.

What I need to do is make sure that the room name (the tag) is still the same in ListView somehow.. at least that's what I am going to try next.. I should not need to have a separate ListView for each room, should I? Isnt that what Tags are for?

Again, it appears that your app is setting the listview data globally for all app users, not for individual users. Fix that in your blocks.

Im thinking it through.. I will get there..

Is there an example anywhere of setting the ListView data for individual users? I cannot figure this out..

Think about it this way:

CloudDB: data
App: user

Let me ask these two questions..

The event blocks ClouDB.GotValue and CloudDB.DataChanged .. does the DataChanged event fire when ever data changes for ANY tag or only the current one that I am using?

And I am not sure how the GotValue event blocks works at all .. when I hover over it, all it tells me is "indicates that a" .. those three words are not very helpful at all.

I am thinking that these blocks have something to do with my issue.

I appreciate the ideas, I really do. I want to figure this out. I guess I am just on the wrong track.

As I see it, and please correct me if I am wrong, CloudDB is a list of lists. Each list is defined by the Tag (the name of the room the user is in) and each of those lists is made up of the ListView elements.. those are the individual messages. The user chooses the tag and should only see the messages available for that particular room. I dont understand how the data is global instead of individual, to me it already is?

  • The dataChanged event will fire whenever any tag value is changed.
  • GotValue does just that, when you request a tag with GetValue, GotValue will return the value for that tag.
  • CloudDB is a key:value (tag:value) database. You can store a single value to the key, or you can store a list to the key, which is returned (with GotValue) as an AI2 list.

GotValue will also fire from an AppendValueToList and not just from a GetValue, right?

This is my current attempt to fix this..


DataChanged fires when any tag is changed. So I added the first If/Then to check if the tag that was changed is equal to the name of the room the user is in. If it is then update the current Liveview. However it doesnt work. Any changes elsewhere still affect the current view. I still do not understand this..

Not as far as I know. You need to run a GetValue to fire a GotValue event....

This will change the chatroom list for all users


I am sorry but I still need an explanation please. I do not see how. I am only removing one message from the current chat room. What am I not understanding?

Is this what I need instead?


When the event fires, its taking away a post from everyones current chat room because of the CurrentChatRoom.Text block?

Perhaps this discussion will help How do you create separate chat rooms?

I think you are playing with fire when you use a ListView1.CreateElement to feed a CloudDB AppendValueToList block.

Who knows what internals structure is in that value, or what kind of pointers are in it?

I would Append a plain text value, JOINING with /

  • ChatName,
  • SystemTime (if you need it for cleanup)
  • ChatText

Actually, I just figured it out and have solved my issue. I was close in my previous try but added an If/Then to both the GotValue and to the DataChanged events and now it is working as desired.


What goes on in one chat room no longer effects what goes on in another. :grin:


Thanks @TIMAI2 .. you made me think it through and I solved my issue.

Well done for working it through :slight_smile:

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.