{"id":1165,"date":"2022-02-11T16:28:50","date_gmt":"2022-02-11T16:28:50","guid":{"rendered":"https:\/\/logicbuilder.integroscrm.com\/help\/?page_id=1165"},"modified":"2022-08-12T16:10:24","modified_gmt":"2022-08-12T16:10:24","slug":"set-variable","status":"publish","type":"page","link":"https:\/\/logicbuilder.integroscrm.com\/help\/set-variable\/","title":{"rendered":"Set Variable"},"content":{"rendered":"\n<p><a name=\"abstract\"><\/a>Sets a value for the variable. Variables can be used as temporary storage for some information. As a value for a variable it may be any data: a value from Sugar Field (output from <a href=\"https:\/\/logicbuilder.integroscrm.com\/help\/get-entity-attributes\/\">Get Entity Attributes<\/a>\/<a href=\"https:\/\/logicbuilder.integroscrm.com\/help\/get-attribute-data\/\">Get Attribute Data<\/a>), computed data (<span style=\"color:#ec8f45;\">Math<\/span> operations), values set directly in the flowchart with <span style=\"color:#ec8f45;\">Constants<\/span>, whole entity, table, structure, array, Boolean, or empty value (empty string or NULL)<\/p>\n\n\n<div style=\"background-color: #ddeaff; border-left: 6px solid #0072b3; padding: 12px;\">\n<p>Note: value in variable &#8216;lives&#8217; within flowchart run and cannot be passed from one flowchart to another one.<\/p>\n<\/div>\n\n\n<p>The most common cases to use variables are:<\/p>\n\n\n\n<ol class=\"wp-block-list\"><li>to get some value that is set within the loop (as it is not possible to get any values directly from a loop outside form it)&nbsp;<a href=\"https:\/\/logicbuilder.integroscrm.com\/help\/wp-content\/uploads\/2022\/02\/img-170-77a06553929343cfa0d46253412ae5d1.png\" rel=\"prettyPhoto\"><img decoding=\"async\" src=\"https:\/\/logicbuilder.integroscrm.com\/help\/wp-content\/uploads\/2022\/02\/img-170-77a06553929343cfa0d46253412ae5d1.png\" alt=\"\" class=\"wp-image-378\"><\/a><\/li><li>when some value is set based on condition &#8211; to merge several flows into one<a href=\"https:\/\/logicbuilder.integroscrm.com\/help\/wp-content\/uploads\/2022\/02\/img-170-beb0260a49584ea7826ad5a98822e235.png\" rel=\"prettyPhoto\"><img decoding=\"async\" src=\"https:\/\/logicbuilder.integroscrm.com\/help\/wp-content\/uploads\/2022\/02\/img-170-beb0260a49584ea7826ad5a98822e235-1024x542.png\" alt=\"\" class=\"wp-image-378\"><\/a><\/li><\/ol>\n\n\n\n<p><strong>inputs:<\/strong><\/p>\n\n\n\n<p>link or specify directly in the operator the name of the variable. It must be unique within the flowchart.<\/p>\n\n\n<div style=\"background-color: #ddeaff; border-left: 6px solid #0072b3; padding: 12px;\">\n<p>Variable names are case-sensitive.&nbsp;<em>Var<\/em>&nbsp;and&nbsp;<em>var<\/em>&nbsp;are two different variables.<\/p>\n<\/div>\n\n\n<ul class=\"wp-block-list\"><li>Required: yes<\/li><\/ul>\n\n\n\n<p><span style=\"color:#6888c9;\">value<\/span>  &#8211; link with the value for this variable. It is a best practice to empty a variable&nbsp;prior to setting the actual value to it.<\/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<figure class=\"wp-block-image size-large is-resized\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/logicbuilder.integroscrm.com\/help\/wp-content\/uploads\/2022\/02\/img-170-876bc6b7c50c45c5bb403b46ebf9724e-1024x392.png\" alt=\"\" class=\"wp-image-1121\" width=\"840\" height=\"322\" srcset=\"https:\/\/logicbuilder.integroscrm.com\/help\/wp-content\/uploads\/2022\/02\/img-170-876bc6b7c50c45c5bb403b46ebf9724e-1024x392.png 1024w, https:\/\/logicbuilder.integroscrm.com\/help\/wp-content\/uploads\/2022\/02\/img-170-876bc6b7c50c45c5bb403b46ebf9724e-300x115.png 300w, https:\/\/logicbuilder.integroscrm.com\/help\/wp-content\/uploads\/2022\/02\/img-170-876bc6b7c50c45c5bb403b46ebf9724e-768x294.png 768w, https:\/\/logicbuilder.integroscrm.com\/help\/wp-content\/uploads\/2022\/02\/img-170-876bc6b7c50c45c5bb403b46ebf9724e-1536x588.png 1536w, https:\/\/logicbuilder.integroscrm.com\/help\/wp-content\/uploads\/2022\/02\/img-170-876bc6b7c50c45c5bb403b46ebf9724e.png 1845w\" sizes=\"auto, (max-width: 840px) 100vw, 840px\" \/><\/figure>\n<div style=\"text-align:left\" class=\"yasr-auto-insert-visitor\"><!--Yasr Visitor Votes Shortcode--><div id='yasr_visitor_votes_1165' class='yasr-visitor-votes'><div class=\"yasr-custom-text-vv-before yasr-custom-text-vv-before-1165\">Click to rate this post!<\/div><div id='yasr-vv-second-row-container-9bec6ab200494' \n                                        class='yasr-vv-second-row-container'><div id='yasr-visitor-votes-rater-9bec6ab200494'\n                                      class='yasr-rater-stars-vv'\n                                      data-rater-postid='1165' \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-9bec6ab200494\"><svg xmlns=\"https:\/\/www.w3.org\/2000\/svg\" width=\"20\" height=\"20\" \n                               class=\"yasr-dashicons-visitor-stats\"\n                               data-postid=\"1165\" \n                               id=\"yasr-stats-dashicon-9bec6ab200494\">\n                            <path d=\"M18 18v-16h-4v16h4zM12 18v-11h-4v11h4zM6 18v-8h-4v8h4z\"><\/path>\n                          <\/svg><span id=\"yasr-vv-text-container-9bec6ab200494\" class=\"yasr-vv-text-container\">[Total: <span id=\"yasr-vv-votes-number-container-9bec6ab200494\">0<\/span>  Average: <span id=\"yasr-vv-average-container-9bec6ab200494\">0<\/span>]<\/span><\/div><div id='yasr-vv-loader-9bec6ab200494' class='yasr-vv-container-loader'><\/div><\/div><div id='yasr-vv-bottom-container-9bec6ab200494' class='yasr-vv-bottom-container'><\/div><\/div><!--End Yasr Visitor Votes Shortcode--><\/div>","protected":false},"excerpt":{"rendered":"<p>Sets a value for the variable. Variables can be used as temporary storage for some information. As a value for a variable it may be any data: a value from Sugar Field (output from Get Entity Attributes\/Get Attribute Data), computed data (Math operations), values set directly in the flowchart with Constants, whole entity, table, structure, &hellip;<\/p>\n<p class=\"read-more\"> <a class=\"\" href=\"https:\/\/logicbuilder.integroscrm.com\/help\/set-variable\/\"> <span class=\"screen-reader-text\">Set Variable<\/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-1165","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\/1165","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=1165"}],"version-history":[{"count":5,"href":"https:\/\/logicbuilder.integroscrm.com\/help\/wp-json\/wp\/v2\/pages\/1165\/revisions"}],"predecessor-version":[{"id":2153,"href":"https:\/\/logicbuilder.integroscrm.com\/help\/wp-json\/wp\/v2\/pages\/1165\/revisions\/2153"}],"wp:attachment":[{"href":"https:\/\/logicbuilder.integroscrm.com\/help\/wp-json\/wp\/v2\/media?parent=1165"}],"wp:term":[{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/logicbuilder.integroscrm.com\/help\/wp-json\/wp\/v2\/tags?post=1165"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}