Developers

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Tyler_Smith
Streaming Star

Modify global field after creation

Hi All,

I've noticed that once a field has been created on the new m.global scope I can no longer add or modify its contents.

Example:
m.global.addFields({
content: {}
})


I cannot then add to or modify m.global.content

I have tried the following ways to modify with no avail:
m.global.content.addReplace("test", "1")
m.global.content = {"test, "1"}
m.global.content.test = "1"


Is this expected? Or am I doing something wrong?
Tyler Smith
Tags (1)
0 Kudos
3 REPLIES 3
TheEndless
Channel Surfer

Re: Modify global field after creation

Modifying the value doesn't work for me, but resetting it to a new AA does. Your code for that is wrong...
m.global.content = {"test, "1"}

should be...
m.global.content = {"test": "1"}

The latter works for me.
My Channels: http://roku.permanence.com - Twitter: @TheEndlessDev
Instant Watch Browser (NetflixIWB), Aquarium Screensaver (AQUARIUM), Clever Clocks Screensaver (CLEVERCLOCKS), iTunes Podcasts (ITPC), My Channels (MYCHANNELS)
Tags (1)
0 Kudos
Tyler_Smith
Streaming Star

Re: Modify global field after creation

FACE PALM FOR ME.

Ok, so now that a full reset of the field is working is it possible to edit a specific value instead of the whole field?
Tyler Smith
Tags (1)
0 Kudos
Tyler_Smith
Streaming Star

Re: Modify global field after creation

I guess something like this would work

print m.global.content
newcontent = m.global.content
newcontent.test = "1"
m.global.content = newcontent
print m.global.content

newcontent = m.global.content
newcontent.test2 = "2"
m.global.content = newcontent
print m.global.content
Tyler Smith
Tags (1)
0 Kudos
Community is Temporarily in Read-Only Mode!

We’re upgrading Roku Community to bring you a faster, more mobile-friendly experience. You may notice limited functionality or read-only access during this time. You will not be able to log in or post new comments or kudos during this time. Read more here.

Planned Downtime:
Community will be unavailable for up to 24–48 hours during the upgrade window during the week of May 12 and you may notice reduced functionality. In the meantime, for additional assistance, visit our Support Site.

Thanks for your patience — we’re excited to share what’s next!