Hi @Mounika_Thakkallapal and @Chris_Knoll,
Here is an example script:
-- Please specify the webapi schema name, this example uses the name "webapi"
-- Step 1: Insert into TAG table.
-- This table hosts tag groups and tag items themselves all in one table. The parent-child relationship between tag groups and tag items will be
-- defined in Step 2 (TAG_GROUP table).
INSERT INTO webapi.tag(name, type, show_group, icon, color, multi_selection,
permission_protected, mandatory, allow_custom, description, created_date)
VALUES(
@tagName, --(Text Type) e.g. @tagName = 'In Progress' Enter a tag name; this is the name of the tag group
@type, --(Integer) e.g. @type = 0; A value of 0 means this is a system-authored tag, a value of 1 is applied by Atlas when a a custom tag is created by an end user.
@showGroup, --(Boolean Type) e.g. @showGroup = FALSE. TRUE means show this as a tag group in the UI. FALSE means this item is not going to be part of a tag group.
@icon, --(text type) e.g. @icon = 'fa fa-stethoscope'. An icon name from Font Awesome library. Use the free icons from this website https://fontawesome.com/v5/search?m=free
@color, --(text type) e.g. @color ='#ff8196' An HTML color for the background-color of the tag in the UI.
@multiSelection, --(Boolean Type) e.g. @multiSelection = FALSE. If this is a tag group, should multiple tag selections be allowed from this tag group?
@permissionProtected, --(Boolean Type) e.g. @permissionProtected = false. Should the usage of this tag be limited to admins only?
@mandatory, --(Boolean Type) e.g. @mandatory = TRUE. If this is a tag group, should a warning message in concept sets, cohort definitions, or characterizations be shown if no tags from the group are selected?
@allowCustom, --(Boolean Type) e.g. @allowCustom = FALSE. If this is a tag group, should you allow a user to add custom tag items to it?
@description, --(Text Type) e.g. @description = 'Asset is in progress'. Enter a description, this field describes the intended use of the tag item.
@createdDate --(Timestamp Type) e.g. NOW(). What timestamp should we use for the tag created date?
)
-- Step 2: If you want to associate a child tag to the parent tag group then insert a record in tag_group table.
-- Relies upon tag ids from step 1.
INSERT INTO webapi.tag_group(
tag_id, group_id)
VALUES (@childTagId, --(Integer) e.g. 1000. This is the tag id assigned in the TAG table for a tag item you wish to add to a tag group.
@parentTagId); --(Integer) e.g. 40. This is the tag id assigned in the TAG table for a tag group that is the parent.
Hope this helps,
Ajit