Widget Section Element: User Activity

The user activity element can be used to display a user's profile details such as name, profile picture, and supporting text. You can consider the activity element as a contact information section. 

Syntax: 


{
type : "user_activity"
user: {},
​text: "",
button_references: {}
}

Attributes: 

Attribute NameValueDescription
typeuser_activitySpecifies the type of widget element. Value for the type key is 'user_activity'.
userJSON ObjectJSON object carrying details of the user. 
text

String

Maximum characters supported: 500. 

The text to be displayed in the element. 
button_references JSON Object The instant button object. To know more about button references, refer here

The user object attributes

Attribute NameValueDescription
idStringThe user ID. 
nameStringThe user's name. 

User object syntax:


{
   "id":user.get("id"), // Or pass a user ID directly as string 
   "name":user.get("name")}, 
 }


Example:


instant_button = {
    "label":"Edit Profile",
    "type":"invoke.function",
    "name":"profileedit",
    "id":"edit",
    "emotion":"positive"
};
elements = list();
elements.add(
    {
        "type":"title",
        "text":"Widget Title"
    }
);
elements.add(
    {
        "type":"text",
        "text":"Here goes the text!"
    }
);
elements.add(
    {
        "type":"user_activity",
        "user":
            {
                "id":"1234567",
                "name":"User Name"
            },
        "text":"You can add text and instant buttons in the user activity element.[Edit Profile]($1)",
        "button_references":{
            "1":instant_button
        }
    }
);
sections = list();
sections.add(
    {
        "id":1,
        "elements":elements
    }
);
return {
    "type":"applet",
    "tabs":[
        {
        "label":"Home",
        "id":"homeTab"
        }
    ],
    "active_tab":"homeTab",
    "sections":sections
};