{"id":28007,"date":"2017-06-16T14:16:42","date_gmt":"2017-06-16T06:16:42","guid":{"rendered":"http:\/\/localhost\/help\/?page_id=28007"},"modified":"2024-01-17T10:48:00","modified_gmt":"2024-01-17T02:48:00","slug":"ddhastemplate","status":"publish","type":"page","link":"https:\/\/oihelp.corporate.ifs.com\/help\/p2-server\/calculations\/ddhastemplate\/","title":{"rendered":"DDHasTemplate()"},"content":{"rendered":"\n<h2>Format<\/h2>\n<p class=\"intro-text\"><strong>DDHasTemplate(Entity,Template[,Templates])<\/strong><\/p>\n<h2>Returns<\/h2>\n<p class=\"intro-text\">Returns a list of Boolean values (True or False) which indicate when a template (or list of templates) was assigned to an entity within the time range of the request.<\/p>\n<p class=\"intro-text\">This function is typically used to find out if an entity has a particular template (e.g. does <em>Well2<\/em> have the <em>Oil Producing Well<\/em> template?). If more than one template name is supplied, <em>False<\/em> will only be returned if none of the templates are assigned.<\/p>\n<p class=\"left-bar-yellow\">It is possible to retrieve very large volumes of data through indiscriminate use of this function. Retrieving large amounts of Historian data across a slow network can affect system performance for all users of the system.<\/p>\n<h2>Inputs<\/h2>\n<p class=\"intro-text\"><b>Entity<\/b>:<b> <\/b>Name of the entity whose template instances should be checked.\u00a0<br \/>\n Behaviour: Required<br \/>\n Dimensions: SingleValue<br \/>\n Valid data types: String<\/p>\n<p class=\"intro-text\"><b>Template<\/b>: The name of a template that is to be checked against the entity.\u00a0<br \/>\n Behaviour: Required<br \/>\n Dimensions: SingleValue<br \/>\n Valid data types: String<\/p>\n<p class=\"intro-text\"><b>Templates<\/b>: Comma-separated list of template names that are to be checked against the entity.\u00a0<br \/>\n Behaviour: Optional (0..n)<br \/>\n Dimensions: SingleValue<br \/>\n Valid data types: String<\/p>\n<p class=\"left-bar\"><a href=\"https:\/\/oihelp.corporate.ifs.com\/help\/p2-server\/calculations\/calculation-syntax\/#Data_Type\">How to properly format data types<\/a><\/p>\n<h2>Examples<\/h2>\n<p class=\"intro-text\">Expression: <span class=\"code-fragment\">DDHasTemplate(\"myEntity\", \"myTemplate\")<\/span><br \/>\n Result: Returns a collection of boolean values which indicate when \"myTemplate\" was or was not assigned to \"myEntity\" within the time range of the fetch request. The timestamp of each value indicates when a template instance started (in case of true value) or ended (in case of false value).<\/p>\n<p class=\"left-bar\">Tip: If you have access to the sample data, try running the following examples using the <a href=\"https:\/\/oihelp.corporate.ifs.com\/help\/p2-server\/configuring-your-system\/creating-a-calculation\/using-the-calculation-tester\/\">calculation tester<\/a>.<\/p>\n<p class=\"intro-text\">Expression: <span class=\"code-fragment\">DDHasTemplate(\"Archer\",\"Oil Producing Well\")<\/span><br \/>\n Result: <span style=\"color: #0000ff;\">True<\/span><\/p>\n<p class=\"intro-text\">Expression: <span class=\"code-fragment\">DDHasTemplate(\"Archer\",\"Area\")<\/span><br \/>\n Result:\u00a0<span style=\"color: #0000ff;\">False<\/span><\/p>\n<p class=\"intro-text\">Expression: <span class=\"code-fragment\">DDHasTemplate(\"Archer\",\"Oil Producing Well\",\"Area\")<\/span><br \/>\n Result: <span style=\"color: #0000ff;\">True<\/span>\u00a0<\/p>\n<p class=\"intro-text\">\u00a0<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Returns a list of Boolean values which indicate when a template (or list of templates) was assigned to an entity within the time range of the request.<\/p>\n<p class=\"continue-reading-button\"> <a class=\"continue-reading-link\" href=\"https:\/\/oihelp.corporate.ifs.com\/help\/p2-server\/calculations\/ddhastemplate\/\">Read more<i class=\"crycon-right-dir\"><\/i><\/a><\/p>\n","protected":false},"author":1,"featured_media":28052,"parent":3650,"menu_order":89,"comment_status":"closed","ping_status":"closed","template":"","meta":{"footnotes":"","_members_access_role":[],"_members_access_error":""},"categories":[9],"tags":[100,282],"class_list":["post-28007","page","type-page","status-publish","has-post-thumbnail","hentry","category-tech-ref","tag-calculations","tag-data-dictionary","Version-4-5-0","Product-srv"],"_links":{"self":[{"href":"https:\/\/oihelp.corporate.ifs.com\/help\/wp-json\/wp\/v2\/pages\/28007","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/oihelp.corporate.ifs.com\/help\/wp-json\/wp\/v2\/pages"}],"about":[{"href":"https:\/\/oihelp.corporate.ifs.com\/help\/wp-json\/wp\/v2\/types\/page"}],"author":[{"embeddable":true,"href":"https:\/\/oihelp.corporate.ifs.com\/help\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/oihelp.corporate.ifs.com\/help\/wp-json\/wp\/v2\/comments?post=28007"}],"version-history":[{"count":1,"href":"https:\/\/oihelp.corporate.ifs.com\/help\/wp-json\/wp\/v2\/pages\/28007\/revisions"}],"predecessor-version":[{"id":46209,"href":"https:\/\/oihelp.corporate.ifs.com\/help\/wp-json\/wp\/v2\/pages\/28007\/revisions\/46209"}],"up":[{"embeddable":true,"href":"https:\/\/oihelp.corporate.ifs.com\/help\/wp-json\/wp\/v2\/pages\/3650"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/oihelp.corporate.ifs.com\/help\/wp-json\/wp\/v2\/media\/28052"}],"wp:attachment":[{"href":"https:\/\/oihelp.corporate.ifs.com\/help\/wp-json\/wp\/v2\/media?parent=28007"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/oihelp.corporate.ifs.com\/help\/wp-json\/wp\/v2\/categories?post=28007"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/oihelp.corporate.ifs.com\/help\/wp-json\/wp\/v2\/tags?post=28007"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}