<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Candidate &amp;quot;placeholder&amp;quot; reference for use in a SQL query? in FlexSim Forum</title>
    <link>https://forums.autodesk.com/t5/flexsim-forum/candidate-quot-placeholder-quot-reference-for-use-in-a-sql-query/m-p/13533801#M42115</link>
    <description>&lt;DIV class="fr-view clearfix"&gt;&lt;P&gt;Hello &lt;A rel="user" href="https://answers.flexsim.com/users/42421/allysonfrancis.html" nodeid="42421"&gt;@Allyson&lt;/A&gt;,&lt;/P&gt;&lt;P&gt;You could use a SQL query like the following&lt;/P&gt;&lt;PRE&gt;value.up == Puller.PullQueue&lt;/PRE&gt;&lt;P&gt;or&lt;/P&gt;&lt;PRE&gt;Queue == Puller.PullQueue // where Queue is defined in the advanced properties of the list&lt;/PRE&gt;&lt;P&gt;&lt;A rel="noopener noreferrer" href="https://answers.flexsim.com/storage/attachments/63069-pull-query.fsm" target="_blank"&gt;Pull Query.fsm&lt;/A&gt;&lt;/P&gt;&lt;P&gt;Please let me know if you need further assistance with this question&lt;/P&gt;&lt;/DIV&gt;</description>
    <pubDate>Thu, 12 Jan 2023 21:04:41 GMT</pubDate>
    <dc:creator>Jeanette_Fullmer</dc:creator>
    <dc:date>2023-01-12T21:04:41Z</dc:date>
    <item>
      <title>Candidate "placeholder" reference for use in a SQL query?</title>
      <link>https://forums.autodesk.com/t5/flexsim-forum/candidate-quot-placeholder-quot-reference-for-use-in-a-sql-query/m-p/13533800#M42114</link>
      <description>&lt;P&gt;&lt;I&gt;[ FlexSim 23.0.0 ]&lt;/I&gt;&lt;/P&gt;&lt;DIV class="fr-view clearfix"&gt;
 &lt;P&gt;My goal is to query an item list for all flow items that are located in a specific parent node. &lt;/P&gt;
 &lt;P&gt;If I knew the exact flow item in question, I could check this condition by:&lt;/P&gt;
 &lt;PRE&gt;if(flowItem.up == parentNode){ //... }&lt;/PRE&gt;
 &lt;P&gt;However, I am searching a list of candidates, so I don't know the specific flow item yet. I have seen elsewhere that some search protocols allow something like "candidate.up == parentNode" to allow a function to be executed on candidates during the search, but I can't find anything like this for FlexSim's SQL search functionality. Is there a way?&lt;/P&gt;
&lt;/DIV&gt;</description>
      <pubDate>Thu, 12 Jan 2023 20:46:06 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/flexsim-forum/candidate-quot-placeholder-quot-reference-for-use-in-a-sql-query/m-p/13533800#M42114</guid>
      <dc:creator>allysonfrancis</dc:creator>
      <dc:date>2023-01-12T20:46:06Z</dc:date>
    </item>
    <item>
      <title>Re: Candidate "placeholder" reference for use in a SQL query?</title>
      <link>https://forums.autodesk.com/t5/flexsim-forum/candidate-quot-placeholder-quot-reference-for-use-in-a-sql-query/m-p/13533801#M42115</link>
      <description>&lt;DIV class="fr-view clearfix"&gt;&lt;P&gt;Hello &lt;A rel="user" href="https://answers.flexsim.com/users/42421/allysonfrancis.html" nodeid="42421"&gt;@Allyson&lt;/A&gt;,&lt;/P&gt;&lt;P&gt;You could use a SQL query like the following&lt;/P&gt;&lt;PRE&gt;value.up == Puller.PullQueue&lt;/PRE&gt;&lt;P&gt;or&lt;/P&gt;&lt;PRE&gt;Queue == Puller.PullQueue // where Queue is defined in the advanced properties of the list&lt;/PRE&gt;&lt;P&gt;&lt;A rel="noopener noreferrer" href="https://answers.flexsim.com/storage/attachments/63069-pull-query.fsm" target="_blank"&gt;Pull Query.fsm&lt;/A&gt;&lt;/P&gt;&lt;P&gt;Please let me know if you need further assistance with this question&lt;/P&gt;&lt;/DIV&gt;</description>
      <pubDate>Thu, 12 Jan 2023 21:04:41 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/flexsim-forum/candidate-quot-placeholder-quot-reference-for-use-in-a-sql-query/m-p/13533801#M42115</guid>
      <dc:creator>Jeanette_Fullmer</dc:creator>
      <dc:date>2023-01-12T21:04:41Z</dc:date>
    </item>
    <item>
      <title>Re: Candidate "placeholder" reference for use in a SQL query?</title>
      <link>https://forums.autodesk.com/t5/flexsim-forum/candidate-quot-placeholder-quot-reference-for-use-in-a-sql-query/m-p/13533802#M42116</link>
      <description>&lt;DIV class="fr-view clearfix"&gt;
 &lt;P&gt;Thanks Jeanette,&lt;BR /&gt;&lt;BR /&gt;So is "value" the wildcard expression that represents a List entry? I tried it in my query and it doesn't work, so I'm trying to make sure I understand what you're suggesting and that my question was clear.&lt;BR /&gt;&lt;BR /&gt;Basically I don't know how to use a FlexScript method in a query without a known object to pass in as the parameter for the method. I'm trying to have the search operation substitute all List objects into the expression and return any which satisfy the condition. So I need to figure out what the wildcard expression is that would enable that to happen, or if there even is one.&lt;BR /&gt;&lt;BR /&gt;Put differently, I understand the right side of the condition equation (how to reference the parent node via the puller parameter) but not the left side of the condition equation (how to compose a query using a FlexScript method that requires the List entry objects as one of the parameters).&lt;BR /&gt;&lt;BR /&gt;Let me know if that doesn't make sense! Thanks again.&lt;/P&gt;
&lt;/DIV&gt;</description>
      <pubDate>Fri, 13 Jan 2023 00:49:54 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/flexsim-forum/candidate-quot-placeholder-quot-reference-for-use-in-a-sql-query/m-p/13533802#M42116</guid>
      <dc:creator>allysonfrancis</dc:creator>
      <dc:date>2023-01-13T00:49:54Z</dc:date>
    </item>
    <item>
      <title>Re: Candidate "placeholder" reference for use in a SQL query?</title>
      <link>https://forums.autodesk.com/t5/flexsim-forum/candidate-quot-placeholder-quot-reference-for-use-in-a-sql-query/m-p/13533803#M42117</link>
      <description>&lt;DIV class="fr-view clearfix"&gt;
 &lt;P&gt;Thanks again Jeanette, with some fiddling around I was able to achieve what I need by entering expressions into the List property fields. I figured out that "value" is indeed a wildcard but only in the expressions fields of the List, not in the query string. So I had to reconfigure everything to reference those List expressions, but now it's sorted. Appreciate the nudge in the right direction!&lt;/P&gt;
&lt;/DIV&gt;</description>
      <pubDate>Fri, 13 Jan 2023 02:02:18 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/flexsim-forum/candidate-quot-placeholder-quot-reference-for-use-in-a-sql-query/m-p/13533803#M42117</guid>
      <dc:creator>allysonfrancis</dc:creator>
      <dc:date>2023-01-13T02:02:18Z</dc:date>
    </item>
    <item>
      <title>Re: Candidate "placeholder" reference for use in a SQL query?</title>
      <link>https://forums.autodesk.com/t5/flexsim-forum/candidate-quot-placeholder-quot-reference-for-use-in-a-sql-query/m-p/13533804#M42118</link>
      <description>&lt;DIV class="fr-view clearfix"&gt;&lt;P&gt;You get it wrong. The keyword is Puller. You can set in a Process Flow a Reference to be parsed into a query clause. I strongly recommend to read more in the manual about &lt;A rel="noopener noreferrer" href="https://docs.flexsim.com/en/23.0/ConnectingFlows/Lists/KeyConceptsLists/KeyConceptsLists.html" target="_blank"&gt;lists&lt;/A&gt;. And there is a section about &lt;A rel="noopener noreferrer" href="https://docs.flexsim.com/en/23.0/Reference/DeveloperAdvancedUser/SQLQueries/SQLQueries.html" target="_blank"&gt;SQL&lt;/A&gt; in reference manual under Advanced User Reference&lt;/P&gt;&lt;P&gt;“value“ is used as the testing element in sql source code to read the pushed items in your list. A query source code tests against all entries if a matching set of conditions get fulfilled as true and put those into an internal result table.&lt;/P&gt;&lt;P&gt;Your list has got entries of pushed items. You can push other values onto a list like references of objects, a simple number, a string or a character. And while you query a list to pull from it, you get exactly the value back that you pushed before.&lt;/P&gt;&lt;P style="margin-left: 20px;"&gt;&lt;EM&gt;Later you can use a SELECT clause to return field values instead of the pushed value in a query. &lt;/EM&gt;&lt;/P&gt;&lt;P&gt;The testing conditional clause value.up == Puller.PullQueue assumes that you set for the keyword Puller a reference to the item and that on this item exists a label called PullQueue with a label value that points to the reference of 3D object into your model. This reference is tested against an “&lt;A rel="noopener noreferrer" href="https://docs.flexsim.com/en/23.0/Reference/CodingInFlexSim/FlexScriptAPIReference/Tree/treenode.html#Property-up" target="_blank"&gt;up&lt;/A&gt;” property of your pushed value of your list. An “up“ property gets the container of the item.&lt;BR /&gt;Jeanette suggested to add a field into your list to replace a query clause value.up by an easier clause that reads the name of this field instead. This suggestion does not reduce any writing of source code. It moves the source code from a query string to a field on a list. But the query string looks later more readable because it is shorter. And you can take a look onto your list entries and find a direct reference to the container of your items then.&lt;/P&gt;&lt;/DIV&gt;</description>
      <pubDate>Fri, 13 Jan 2023 04:03:40 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/flexsim-forum/candidate-quot-placeholder-quot-reference-for-use-in-a-sql-query/m-p/13533804#M42118</guid>
      <dc:creator>joerg_vogel_HsH</dc:creator>
      <dc:date>2023-01-13T04:03:40Z</dc:date>
    </item>
    <item>
      <title>Re: Candidate "placeholder" reference for use in a SQL query?</title>
      <link>https://forums.autodesk.com/t5/flexsim-forum/candidate-quot-placeholder-quot-reference-for-use-in-a-sql-query/m-p/13533805#M42119</link>
      <description>&lt;DIV class="fr-view clearfix"&gt;Another thing to consider is partitioning by the item's location which then means you don't need to access puller.PullQueue you can just put that expression in the partition of the pull from list activity (if you have pushed to the correct partition).&lt;/DIV&gt;</description>
      <pubDate>Fri, 13 Jan 2023 13:52:32 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/flexsim-forum/candidate-quot-placeholder-quot-reference-for-use-in-a-sql-query/m-p/13533805#M42119</guid>
      <dc:creator>jason_lightfoot_adsk</dc:creator>
      <dc:date>2023-01-13T13:52:32Z</dc:date>
    </item>
    <item>
      <title>Re: Candidate "placeholder" reference for use in a SQL query?</title>
      <link>https://forums.autodesk.com/t5/flexsim-forum/candidate-quot-placeholder-quot-reference-for-use-in-a-sql-query/m-p/13533806#M42120</link>
      <description>&lt;DIV class="fr-view clearfix"&gt;
 &lt;P&gt;Thanks Joerg, perhaps my issue was not clear. As I mentioned above, I understand the right side of the condition equation (i.e. where I would be referencing the parent node via the puller parameter), as this is well documented in the FlexSim manual. The issue I was having was figuring out the left side of the equation, i.e. where the ".up" method would need to be evaluated on &lt;EM&gt;&lt;U&gt;each&lt;/U&gt;&lt;/EM&gt; List entry in order to check the condition. I did not know the wildcard term to use to indicate that I wanted the ".up" method to be checked on&lt;EM&gt; &lt;U&gt;each&lt;/U&gt;&lt;/EM&gt; entry, as I couldn't find it in any of the FlexSim documentation. But in digging into the List advanced properties (thanks to Jeanette's prompting) and seeing the example expression fields that appear on items lists by default, I was able to infer that "value" is the term used in the expression field as the wildcard that represents any entry. Or as you put it, "the testing element in sql source code to read the pushed items in your list".&lt;BR /&gt;&lt;BR /&gt;Logically this would mean I should also be able to use "value.up" directly in my query string in my FlexScript code, because as you said, this would just be moving the same source code from a field on a list to the query string, but ultimately the executed code would be the same. However when I tried it, FlexSim threw errors, but the exact same query worked just fine when I entered it in the expression field. So rather than try to debug why it would not work directly in my query string, I'm just using expression field, as I know it works. This may be a bug or it may be user error, but either way I didn't want to lose half a day trying to figure it out.&lt;BR /&gt;&lt;BR /&gt;I've also had some issues using "nullvar" in comparisons, both in sql queries and in logical if statements. Sometimes it works directly and sometimes it doesn't, which I assume is due to a type casting issue. So I get around that by declaring a new Object variable initialized with a value of "nullvar", and then use that for the comparison instead. However since I was limited to one puller parameter, I couldn't pass my null object into the query and had to use the expression fields as a workaround for this as well.&lt;BR /&gt;&lt;BR /&gt;Ultimately I went from this (where neither clause worked):&lt;/P&gt;
 &lt;PRE&gt;Object parentNode = Model.find("ToteHolding");
String query = "WHERE value.up = puller AND BatchToken = nullvar";
List.PullResult pulled = List("Totes").pull(query,1,1,parentNode,nullvar,LIST_DO_NOT_REMOVE);&lt;/PRE&gt;
 &lt;P&gt;to this (which does work):&lt;/P&gt;
 &lt;PRE&gt;Object parentNode = Model.find("ToteHolding");
String query = "WHERE ParentNode = puller AND Allocated = 0";
List.PullResult pulled = List("Totes").pull(query,1,1,parentNode,nullvar,LIST_DO_NOT_REMOVE);&lt;/PRE&gt;
 &lt;P&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="1673637977365.png"&gt;&lt;img src="https://forums.autodesk.com/t5/image/serverpage/image-id/1514828iB09CF49D9BF46554/image-size/large?v=v2&amp;amp;px=999" role="button" title="1673637977365.png" alt="1673637977365.png" /&gt;&lt;/span&gt;&lt;/P&gt;
 &lt;P&gt;&lt;BR /&gt;Just wanted to explain with better detail and (hopefully) more clarity exactly what I was trying to solve and how I solved it, in case other users find it helpful.&lt;/P&gt;
&lt;/DIV&gt;</description>
      <pubDate>Fri, 13 Jan 2023 19:27:54 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/flexsim-forum/candidate-quot-placeholder-quot-reference-for-use-in-a-sql-query/m-p/13533806#M42120</guid>
      <dc:creator>allysonfrancis</dc:creator>
      <dc:date>2023-01-13T19:27:54Z</dc:date>
    </item>
    <item>
      <title>Re: Candidate "placeholder" reference for use in a SQL query?</title>
      <link>https://forums.autodesk.com/t5/flexsim-forum/candidate-quot-placeholder-quot-reference-for-use-in-a-sql-query/m-p/13533807#M42121</link>
      <description>&lt;DIV class="fr-view clearfix"&gt;
 Interesting point! Is the partition dynamic though? I would be keeping the items on the list while they move through the facility so if the partition is only set when the item is pushed, this wouldn't work. But possibly a good option for another use case.
&lt;/DIV&gt;</description>
      <pubDate>Fri, 13 Jan 2023 19:33:34 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/flexsim-forum/candidate-quot-placeholder-quot-reference-for-use-in-a-sql-query/m-p/13533807#M42121</guid>
      <dc:creator>allysonfrancis</dc:creator>
      <dc:date>2023-01-13T19:33:34Z</dc:date>
    </item>
    <item>
      <title>Re: Candidate "placeholder" reference for use in a SQL query?</title>
      <link>https://forums.autodesk.com/t5/flexsim-forum/candidate-quot-placeholder-quot-reference-for-use-in-a-sql-query/m-p/13533808#M42122</link>
      <description>&lt;DIV class="fr-view clearfix"&gt;&lt;P&gt;From a test I did with the following model it does not look like the Partition is Dynamic. &lt;/P&gt;&lt;P&gt;&lt;A rel="noopener noreferrer" href="https://answers.flexsim.com/storage/attachments/63097-pull-query-1.fsm" target="_blank"&gt;Pull Query_1.fsm&lt;/A&gt;&lt;/P&gt;&lt;/DIV&gt;</description>
      <pubDate>Fri, 13 Jan 2023 20:41:56 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/flexsim-forum/candidate-quot-placeholder-quot-reference-for-use-in-a-sql-query/m-p/13533808#M42122</guid>
      <dc:creator>Jeanette_Fullmer</dc:creator>
      <dc:date>2023-01-13T20:41:56Z</dc:date>
    </item>
    <item>
      <title>Re: Candidate "placeholder" reference for use in a SQL query?</title>
      <link>https://forums.autodesk.com/t5/flexsim-forum/candidate-quot-placeholder-quot-reference-for-use-in-a-sql-query/m-p/13533809#M42123</link>
      <description>&lt;DIV class="fr-view clearfix"&gt;&lt;P&gt;Hi &lt;A rel="user" href="https://answers.flexsim.com/users/42421/allysonfrancis.html" nodeid="42421"&gt;@Allyson&lt;/A&gt;, was Jeanette F's answer helpful? If so, please click the "Accept" button at the bottom of their answer. Or if you still have questions, add a comment and we'll continue the conversation.&lt;/P&gt;&lt;P&gt;If we haven't heard back from you within 3 business days we'll auto-accept an answer, but you can always unaccept and comment back to reopen your question.&lt;/P&gt;&lt;/DIV&gt;</description>
      <pubDate>Wed, 18 Jan 2023 20:56:18 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/flexsim-forum/candidate-quot-placeholder-quot-reference-for-use-in-a-sql-query/m-p/13533809#M42123</guid>
      <dc:creator>Jeanette_Fullmer</dc:creator>
      <dc:date>2023-01-18T20:56:18Z</dc:date>
    </item>
  </channel>
</rss>

