Forum Discussion

uj24153's avatar
uj24153
Binge Watcher
4 years ago
Solved

Tried to set nonexistent field "email" of a "ContentNode" node

this is error

Warning occurred while setting a field of an RoSGNode
-- Tried to set nonexistent field "email" of a "ContentNode" node
pkg:/components/HomeScreen/HomeScreenTaskReader.brs(133)

and this is code for assigning values to Content Node

function getCategoriesItem(p as object)

    item = {}
    if p.id <> invalid
        ?" id " p.id
        item.id = p.id
    else
        item.id = invalid
    end if

    if p.email <> invalid
        ?" email " p.email
        item.Email = p.email
    end if

    if p.image_url <> invalid
        ?" image_url " p.image_url
        item.HDPosterUrl = p.image_url
    end if

    if p.name <> invalid
        ?" name " p.name
        item.Title = p.name
    end if

    return item
end function

there is no error for Title, id, poster but why email is not assigning to it.
kindly help

 

  • Hi uj24153,

    You’ll need to add an Email field to the content node before you can use it.  You can either create an object that extends a ContentNode and add Email as an interface field, or you can add it by calling p.addField(“Email”, “string”, true).  This will add the Email field to your ContentNode so you can assign values to it or reference it.

4 Replies

  • RokuJonathanD's avatar
    RokuJonathanD
    Community Moderator

    Hi uj24153,

    Are you trying to populate a ContentNode using the content metadata fields? If so, email is not a valid field. Otherwise, can you provide more context around with API you are using (for example, ChannelStore) so we can better help you?

    Thanks,

    Jonathan

  • RobMich's avatar
    RobMich
    Channel Surfer

    Hi uj24153,

    You’ll need to add an Email field to the content node before you can use it.  You can either create an object that extends a ContentNode and add Email as an interface field, or you can add it by calling p.addField(“Email”, “string”, true).  This will add the Email field to your ContentNode so you can assign values to it or reference it.