{"id":932,"date":"2022-01-20T15:45:27","date_gmt":"2022-01-20T15:45:27","guid":{"rendered":"https:\/\/logicbuilder.integroscrm.com\/help\/?page_id=932"},"modified":"2022-06-10T10:20:52","modified_gmt":"2022-06-10T10:20:52","slug":"set-entity-teams","status":"publish","type":"page","link":"https:\/\/logicbuilder.integroscrm.com\/help\/set-entity-teams\/","title":{"rendered":"Set Entity Teams"},"content":{"rendered":"\n<p><a name=\"abstract\"><\/a>Updates Team Set for a Record. Use it whenever it is needed to completely update team_set_id for the record, not just add or remove.<\/p>\n\n\n<div style=\"background-color: #ddeaff; border-left: 6px solid #0072b3; padding: 12px;\">\n<ul>\n<li>In Sugar each teamset for record consists of two components:&nbsp;<em>team_id<\/em>&nbsp;as Primary Team and&nbsp;<em>team_set_id<\/em>&nbsp;as all other teams.&nbsp;<strong><span style=\"color:#ec8f45;\">Set Entity Teams<\/span><\/strong>&nbsp;works with&nbsp;<em>team_set_id<\/em>&nbsp;only.<\/li>\n<li>The recommended approach is to use&nbsp;<strong><span style=\"color:#ec8f45;\">Set Entity Teams<\/span><\/strong>&nbsp;on After Save flowcharts than on Before Save.<\/li>\n<li>Do not use&nbsp;<strong><span style=\"color:#ec8f45;\">Save Entity<\/span><\/strong>&nbsp;to preserve team changes.&nbsp;<strong><span style=\"color:#ec8f45;\">Set Entity Teams<\/span><\/strong>&nbsp;applies team changes itself.<\/li>\n<li>Despite any changes that might be applied with&nbsp;<strong><span style=\"color:#ec8f45;\">Set Entity Teams<\/span><\/strong>, the standard Sugar logic, which ensures access of Assigned User to a record, works. Let\u2019s say that you created flowcharts and because of its execution teamset for the record do not contain any Team, to which an Assigned user belongs. In this case, standard Sugar behavior adds Assigned Users\u2019 Private Team.<\/li>\n<\/ul>\n<\/div>\n\n\n<p><strong>inputs:<\/strong><\/p>\n\n\n\n<p><span style=\"color:#ef6950;\">entity<\/span> \u2013 input record which teams are needed to update<\/p>\n\n\n\n<ul class=\"wp-block-list\"><li>Required: yes<\/li><\/ul>\n\n\n\n<p><span style=\"color:#6888c9;\">teams ids array<\/span> \u2013 input array or collection of teams for the record or just one ID of the Team. Please note that this input must contain the whole set of teams.<\/p>\n\n\n\n<ul class=\"wp-block-list\"><li>Required: yes<\/li><\/ul>\n\n\n\n<p><strong>outputs:<\/strong><\/p>\n\n\n\n<p><span style=\"color:#ef6950;\">entity<\/span> \u2013 the record with updated teams.<\/p>\n\n\n\n<p>The following example completely overrides team_set with one Team West:<\/p>\n\n\n<p><a href=\"https:\/\/logicbuilder.integroscrm.com\/help\/wp-content\/uploads\/2022\/02\/img-185-a08b101314974c8e9e23633225d8cee9.png\" rel=\"prettyPhoto\"><img decoding=\"async\" src=\"https:\/\/logicbuilder.integroscrm.com\/help\/wp-content\/uploads\/2022\/02\/img-185-a08b101314974c8e9e23633225d8cee9-1024x292.png\" alt=\"\" class=\"wp-image-378\"><\/a><\/p>\n\n\n<p>The following flowchart adds team West to the current set of Teams for Account when Country is changed to the value USA:&nbsp;<\/p>\n\n\n<p><a href=\"https:\/\/logicbuilder.integroscrm.com\/help\/wp-content\/uploads\/2022\/02\/img-185-3b76344399b24254bd7b9fd6a8d5375f.png\" rel=\"prettyPhoto\"><img decoding=\"async\" src=\"https:\/\/logicbuilder.integroscrm.com\/help\/wp-content\/uploads\/2022\/02\/img-185-3b76344399b24254bd7b9fd6a8d5375f-1024x322.png\" alt=\"\" class=\"wp-image-378\"><\/a><\/p>\n\n\n<p>The following flowchart removes team East from the Teams of Account when Country is changed from the value UK (Please note, that team East won\u2019t be removed when it is set as Primary):<\/p>\n\n\n<p><a href=\"https:\/\/logicbuilder.integroscrm.com\/help\/wp-content\/uploads\/2022\/02\/img-185-44440ec2a3f24ec58a83707a32709071.png\" rel=\"prettyPhoto\"><img decoding=\"async\" src=\"https:\/\/logicbuilder.integroscrm.com\/help\/wp-content\/uploads\/2022\/02\/img-185-44440ec2a3f24ec58a83707a32709071-1024x419.png\" alt=\"\" class=\"wp-image-378\"><\/a><\/p>\n\n\n<p><em><em>N.B. in the examples above collection is converted to the array, but instead of collections, it is possible to use operators from the Array group.<\/em><\/em><\/p>\n<div style=\"text-align:left\" class=\"yasr-auto-insert-visitor\"><!--Yasr Visitor Votes Shortcode--><div id='yasr_visitor_votes_932' class='yasr-visitor-votes'><div class=\"yasr-custom-text-vv-before yasr-custom-text-vv-before-932\">Click to rate this post!<\/div><div id='yasr-vv-second-row-container-c94eace626f06' \n                                        class='yasr-vv-second-row-container'><div id='yasr-visitor-votes-rater-c94eace626f06'\n                                      class='yasr-rater-stars-vv'\n                                      data-rater-postid='932' \n                                      data-rating='0'\n                                      data-rater-starsize='24'\n                                      data-rater-readonly='false'\n                                      data-rater-nonce='fa81b01ba5' \n                                      data-issingular='false'\n                                    ><\/div><div class=\"yasr-vv-stats-text-container\" id=\"yasr-vv-stats-text-container-c94eace626f06\"><svg xmlns=\"https:\/\/www.w3.org\/2000\/svg\" width=\"20\" height=\"20\" \n                               class=\"yasr-dashicons-visitor-stats\"\n                               data-postid=\"932\" \n                               id=\"yasr-stats-dashicon-c94eace626f06\">\n                            <path d=\"M18 18v-16h-4v16h4zM12 18v-11h-4v11h4zM6 18v-8h-4v8h4z\"><\/path>\n                          <\/svg><span id=\"yasr-vv-text-container-c94eace626f06\" class=\"yasr-vv-text-container\">[Total: <span id=\"yasr-vv-votes-number-container-c94eace626f06\">0<\/span>  Average: <span id=\"yasr-vv-average-container-c94eace626f06\">0<\/span>]<\/span><\/div><div id='yasr-vv-loader-c94eace626f06' class='yasr-vv-container-loader'><\/div><\/div><div id='yasr-vv-bottom-container-c94eace626f06' class='yasr-vv-bottom-container'><\/div><\/div><!--End Yasr Visitor Votes Shortcode--><\/div>","protected":false},"excerpt":{"rendered":"<p>Updates Team Set for a Record. Use it whenever it is needed to completely update team_set_id for the record, not just add or remove. In Sugar each teamset for record consists of two components:&nbsp;team_id&nbsp;as Primary Team and&nbsp;team_set_id&nbsp;as all other teams.&nbsp;Set Entity Teams&nbsp;works with&nbsp;team_set_id&nbsp;only. The recommended approach is to use&nbsp;Set Entity Teams&nbsp;on After Save flowcharts than &hellip;<\/p>\n<p class=\"read-more\"> <a class=\"\" href=\"https:\/\/logicbuilder.integroscrm.com\/help\/set-entity-teams\/\"> <span class=\"screen-reader-text\">Set Entity Teams<\/span> Read More &raquo;<\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"parent":0,"menu_order":0,"comment_status":"open","ping_status":"closed","template":"","meta":{"yasr_overall_rating":0,"yasr_post_is_review":"","yasr_auto_insert_disabled":"","yasr_review_type":"","footnotes":""},"tags":[],"class_list":["post-932","page","type-page","status-publish","hentry"],"yasr_visitor_votes":{"number_of_votes":0,"sum_votes":0,"stars_attributes":{"read_only":false,"span_bottom":false}},"_links":{"self":[{"href":"https:\/\/logicbuilder.integroscrm.com\/help\/wp-json\/wp\/v2\/pages\/932","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/logicbuilder.integroscrm.com\/help\/wp-json\/wp\/v2\/pages"}],"about":[{"href":"https:\/\/logicbuilder.integroscrm.com\/help\/wp-json\/wp\/v2\/types\/page"}],"author":[{"embeddable":true,"href":"https:\/\/logicbuilder.integroscrm.com\/help\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/logicbuilder.integroscrm.com\/help\/wp-json\/wp\/v2\/comments?post=932"}],"version-history":[{"count":5,"href":"https:\/\/logicbuilder.integroscrm.com\/help\/wp-json\/wp\/v2\/pages\/932\/revisions"}],"predecessor-version":[{"id":1805,"href":"https:\/\/logicbuilder.integroscrm.com\/help\/wp-json\/wp\/v2\/pages\/932\/revisions\/1805"}],"wp:attachment":[{"href":"https:\/\/logicbuilder.integroscrm.com\/help\/wp-json\/wp\/v2\/media?parent=932"}],"wp:term":[{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/logicbuilder.integroscrm.com\/help\/wp-json\/wp\/v2\/tags?post=932"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}