{"id":5578,"date":"2017-11-22T19:43:17","date_gmt":"2017-11-22T19:43:17","guid":{"rendered":"https:\/\/alt2.minisoft.com\/support\/?p=5578"},"modified":"2020-07-01T13:03:32","modified_gmt":"2020-07-01T20:03:32","slug":"choose-one-of","status":"publish","type":"post","link":"https:\/\/c002.minisoft.com\/support\/choose-one-of\/","title":{"rendered":"Choose One Of"},"content":{"rendered":"<p>The &#8216;Choose One Of&#8217; function can be used to choose a specific instance from an array by index or by matching against a parallel occurring variable. This function is particularly useful for extracting an item from an array of values.<\/p>\n<h2>Sample: First Item in an Array<\/h2>\n<p>The following example shows how to pull separate items from a group (a list) by the index. To follow along, download the files here:<\/p>\n<p><a class=\"fancyButton\" href=\"\/support\/wp-content\/uploads\/2017\/11\/ChooseOneOf.zip\">Choose One Of<\/a><\/p>\n<p>1. Right click \u2018lines\u2019 and select Add Variable.<\/p>\n<p><a href=\"https:\/\/alt2.minisoft.com\/support\/wp-content\/uploads\/2017\/11\/RepeatIndex-1.png\"><img decoding=\"async\" loading=\"lazy\" class=\"alignnone size-full wp-image-5404\" src=\"https:\/\/alt2.minisoft.com\/support\/wp-content\/uploads\/2017\/11\/RepeatIndex-1.png\" sizes=\"(max-width: 390px) 100vw, 390px\" srcset=\"https:\/\/alt2.minisoft.com\/support\/wp-content\/uploads\/2017\/11\/RepeatIndex-1.png 390w, https:\/\/alt2.minisoft.com\/support\/wp-content\/uploads\/2017\/11\/RepeatIndex-1-300x172.png 300w, https:\/\/alt2.minisoft.com\/support\/wp-content\/uploads\/2017\/11\/RepeatIndex-1-150x86.png 150w, https:\/\/alt2.minisoft.com\/support\/wp-content\/uploads\/2017\/11\/RepeatIndex-1-250x144.png 250w, https:\/\/alt2.minisoft.com\/support\/wp-content\/uploads\/2017\/11\/RepeatIndex-1-313x180.png 313w\" alt=\"\" width=\"390\" height=\"224\" \/><\/a><\/p>\n<p>2. The Variable dialog box displays. Select OK to continue.<\/p>\n<p><a href=\"https:\/\/alt2.minisoft.com\/support\/wp-content\/uploads\/2017\/11\/RepeatIndex-2.png\"><img decoding=\"async\" loading=\"lazy\" class=\"alignnone size-full wp-image-5405\" src=\"https:\/\/alt2.minisoft.com\/support\/wp-content\/uploads\/2017\/11\/RepeatIndex-2.png\" sizes=\"(max-width: 492px) 100vw, 492px\" srcset=\"https:\/\/alt2.minisoft.com\/support\/wp-content\/uploads\/2017\/11\/RepeatIndex-2.png 492w, https:\/\/alt2.minisoft.com\/support\/wp-content\/uploads\/2017\/11\/RepeatIndex-2-300x214.png 300w, https:\/\/alt2.minisoft.com\/support\/wp-content\/uploads\/2017\/11\/RepeatIndex-2-150x107.png 150w, https:\/\/alt2.minisoft.com\/support\/wp-content\/uploads\/2017\/11\/RepeatIndex-2-250x178.png 250w, https:\/\/alt2.minisoft.com\/support\/wp-content\/uploads\/2017\/11\/RepeatIndex-2-252x180.png 252w, https:\/\/alt2.minisoft.com\/support\/wp-content\/uploads\/2017\/11\/RepeatIndex-2-421x300.png 421w, https:\/\/alt2.minisoft.com\/support\/wp-content\/uploads\/2017\/11\/RepeatIndex-2-210x150.png 210w, https:\/\/alt2.minisoft.com\/support\/wp-content\/uploads\/2017\/11\/RepeatIndex-2-400x285.png 400w\" alt=\"\" width=\"492\" height=\"351\" \/><\/a><\/p>\n<p>3. In the Project Window, right click the form and select Add Variable &gt; By position. Enter \u2018line1\u2019 in the Name field and select OK.<\/p>\n<p><a href=\"https:\/\/alt2.minisoft.com\/support\/wp-content\/uploads\/2017\/11\/RepeatIndex-3.png\"><img decoding=\"async\" loading=\"lazy\" class=\"alignnone size-full wp-image-5406\" src=\"https:\/\/alt2.minisoft.com\/support\/wp-content\/uploads\/2017\/11\/RepeatIndex-3.png\" sizes=\"(max-width: 434px) 100vw, 434px\" srcset=\"https:\/\/alt2.minisoft.com\/support\/wp-content\/uploads\/2017\/11\/RepeatIndex-3.png 434w, https:\/\/alt2.minisoft.com\/support\/wp-content\/uploads\/2017\/11\/RepeatIndex-3-300x206.png 300w, https:\/\/alt2.minisoft.com\/support\/wp-content\/uploads\/2017\/11\/RepeatIndex-3-150x103.png 150w, https:\/\/alt2.minisoft.com\/support\/wp-content\/uploads\/2017\/11\/RepeatIndex-3-250x172.png 250w, https:\/\/alt2.minisoft.com\/support\/wp-content\/uploads\/2017\/11\/RepeatIndex-3-262x180.png 262w\" alt=\"\" width=\"434\" height=\"298\" \/><\/a><\/p>\n<p>4. Right click the \u2018line1\u2019 variable from the Project Window and select Add Pre-condition Procedure &gt; Set Variable. Enter \u2018First\u2019 in the Name field. From the Use variable field, select the \u2018lines\u2019 variable created earlier. Select OK.<\/p>\n<p><a href=\"https:\/\/alt2.minisoft.com\/support\/wp-content\/uploads\/2017\/11\/First-procedure.png\"><img decoding=\"async\" loading=\"lazy\" class=\"alignnone size-full wp-image-5584\" src=\"https:\/\/alt2.minisoft.com\/support\/wp-content\/uploads\/2017\/11\/First-procedure.png\" alt=\"\" width=\"362\" height=\"208\" srcset=\"https:\/\/c002.minisoft.com\/support\/wp-content\/uploads\/2017\/11\/First-procedure.png 362w, https:\/\/c002.minisoft.com\/support\/wp-content\/uploads\/2017\/11\/First-procedure-300x172.png 300w, https:\/\/c002.minisoft.com\/support\/wp-content\/uploads\/2017\/11\/First-procedure-150x86.png 150w, https:\/\/c002.minisoft.com\/support\/wp-content\/uploads\/2017\/11\/First-procedure-250x144.png 250w, https:\/\/c002.minisoft.com\/support\/wp-content\/uploads\/2017\/11\/First-procedure-313x180.png 313w\" sizes=\"(max-width: 362px) 100vw, 362px\" \/><\/a><\/p>\n<p>5. The Set Variable Action dialog box displays. Select \u2018line1\u2019 from the Variable drop-down menu. Select OK.<\/p>\n<p><a href=\"https:\/\/alt2.minisoft.com\/support\/wp-content\/uploads\/2017\/11\/RepeatIndex-5.png\"><img decoding=\"async\" loading=\"lazy\" class=\"alignnone size-full wp-image-5408\" src=\"https:\/\/alt2.minisoft.com\/support\/wp-content\/uploads\/2017\/11\/RepeatIndex-5.png\" sizes=\"(max-width: 336px) 100vw, 336px\" srcset=\"https:\/\/alt2.minisoft.com\/support\/wp-content\/uploads\/2017\/11\/RepeatIndex-5.png 336w, https:\/\/alt2.minisoft.com\/support\/wp-content\/uploads\/2017\/11\/RepeatIndex-5-300x112.png 300w, https:\/\/alt2.minisoft.com\/support\/wp-content\/uploads\/2017\/11\/RepeatIndex-5-150x56.png 150w, https:\/\/alt2.minisoft.com\/support\/wp-content\/uploads\/2017\/11\/RepeatIndex-5-250x93.png 250w\" alt=\"\" width=\"336\" height=\"125\" \/><\/a><\/p>\n<p>6. Right click the procedure [First (lines)] and select Add Function &gt; Choose one of. From the &#8216;Choices in variable&#8217; drop-down menu, select the &#8216;lines&#8217; variable created earlier. Select &#8216;Choose using index&#8217; and from the &#8216;Index&#8217; field select &#8216;Constant&#8217; and enter the numeric value &#8216;1&#8217; to retrieve the first value in the selected array. Select OK.<\/p>\n<p><a href=\"https:\/\/alt2.minisoft.com\/support\/wp-content\/uploads\/2017\/11\/Choose-one-of.png\"><img decoding=\"async\" loading=\"lazy\" class=\"alignnone size-full wp-image-5586\" src=\"https:\/\/alt2.minisoft.com\/support\/wp-content\/uploads\/2017\/11\/Choose-one-of.png\" alt=\"\" width=\"444\" height=\"396\" srcset=\"https:\/\/c002.minisoft.com\/support\/wp-content\/uploads\/2017\/11\/Choose-one-of.png 444w, https:\/\/c002.minisoft.com\/support\/wp-content\/uploads\/2017\/11\/Choose-one-of-300x268.png 300w, https:\/\/c002.minisoft.com\/support\/wp-content\/uploads\/2017\/11\/Choose-one-of-150x134.png 150w, https:\/\/c002.minisoft.com\/support\/wp-content\/uploads\/2017\/11\/Choose-one-of-250x223.png 250w, https:\/\/c002.minisoft.com\/support\/wp-content\/uploads\/2017\/11\/Choose-one-of-202x180.png 202w, https:\/\/c002.minisoft.com\/support\/wp-content\/uploads\/2017\/11\/Choose-one-of-336x300.png 336w\" sizes=\"(max-width: 444px) 100vw, 444px\" \/><\/a><\/p>\n<p>7. Left click and drag the &#8220;Choose one of&#8221; procedure(s) and place it above the &#8220;Set variable&#8221; action(s). It should like the following:<\/p>\n<p><a href=\"https:\/\/alt2.minisoft.com\/support\/wp-content\/uploads\/2017\/11\/ChooseOneOf-Add.png\"><img decoding=\"async\" loading=\"lazy\" class=\"alignnone size-full wp-image-6784\" src=\"https:\/\/alt2.minisoft.com\/support\/wp-content\/uploads\/2017\/11\/ChooseOneOf-Add.png\" alt=\"\" width=\"287\" height=\"228\" srcset=\"https:\/\/c002.minisoft.com\/support\/wp-content\/uploads\/2017\/11\/ChooseOneOf-Add.png 287w, https:\/\/c002.minisoft.com\/support\/wp-content\/uploads\/2017\/11\/ChooseOneOf-Add-150x119.png 150w, https:\/\/c002.minisoft.com\/support\/wp-content\/uploads\/2017\/11\/ChooseOneOf-Add-250x199.png 250w, https:\/\/c002.minisoft.com\/support\/wp-content\/uploads\/2017\/11\/ChooseOneOf-Add-227x180.png 227w\" sizes=\"(max-width: 287px) 100vw, 287px\" \/><\/a><\/p>\n<p>8. To retrieve additional individual items, repeat steps 3-6 as needed, adjusting the naming conventions as required. The results can be viewed in the Variables Window.<\/p>\n<p><a href=\"https:\/\/alt2.minisoft.com\/support\/wp-content\/uploads\/2017\/11\/RepeatIndex-7.png\"><img decoding=\"async\" loading=\"lazy\" class=\"alignnone size-full wp-image-5410\" src=\"https:\/\/alt2.minisoft.com\/support\/wp-content\/uploads\/2017\/11\/RepeatIndex-7.png\" sizes=\"(max-width: 284px) 100vw, 284px\" srcset=\"https:\/\/alt2.minisoft.com\/support\/wp-content\/uploads\/2017\/11\/RepeatIndex-7.png 284w, https:\/\/alt2.minisoft.com\/support\/wp-content\/uploads\/2017\/11\/RepeatIndex-7-150x115.png 150w, https:\/\/alt2.minisoft.com\/support\/wp-content\/uploads\/2017\/11\/RepeatIndex-7-250x191.png 250w, https:\/\/alt2.minisoft.com\/support\/wp-content\/uploads\/2017\/11\/RepeatIndex-7-236x180.png 236w\" alt=\"\" width=\"284\" height=\"217\" \/><\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>The &#8216;Choose One Of&#8217; function can be used to choose a specific instance from an array by index or by matching against a parallel occurring variable. This function is particularly useful for extracting an item from an array of values. Sample: First Item in an Array The following example shows how to pull separate items [&hellip;]<\/p>\n","protected":false},"author":75,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[3,10],"tags":[407,288,408,101,255],"_links":{"self":[{"href":"https:\/\/c002.minisoft.com\/support\/wp-json\/wp\/v2\/posts\/5578"}],"collection":[{"href":"https:\/\/c002.minisoft.com\/support\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/c002.minisoft.com\/support\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/c002.minisoft.com\/support\/wp-json\/wp\/v2\/users\/75"}],"replies":[{"embeddable":true,"href":"https:\/\/c002.minisoft.com\/support\/wp-json\/wp\/v2\/comments?post=5578"}],"version-history":[{"count":7,"href":"https:\/\/c002.minisoft.com\/support\/wp-json\/wp\/v2\/posts\/5578\/revisions"}],"predecessor-version":[{"id":8167,"href":"https:\/\/c002.minisoft.com\/support\/wp-json\/wp\/v2\/posts\/5578\/revisions\/8167"}],"wp:attachment":[{"href":"https:\/\/c002.minisoft.com\/support\/wp-json\/wp\/v2\/media?parent=5578"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/c002.minisoft.com\/support\/wp-json\/wp\/v2\/categories?post=5578"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/c002.minisoft.com\/support\/wp-json\/wp\/v2\/tags?post=5578"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}