<?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: How to query Lists for entries by fields from Label in FlexSim Forum</title>
    <link>https://forums.autodesk.com/t5/flexsim-forum/how-to-query-lists-for-entries-by-fields-from-label/m-p/13514090#M26471</link>
    <description>&lt;DIV class="fr-view clearfix"&gt;&lt;P&gt;When you're using the Pull from List activity in Process Flow, you cannot use &lt;EM&gt;token&lt;/EM&gt; directly in the query.&lt;/P&gt;&lt;P&gt;Instead, you can reference an intermediary object called the &lt;EM&gt;puller. &lt;/EM&gt;By default, the puller &lt;STRONG&gt;is&lt;/STRONG&gt; equal to the token that is performing the query, so you can just replace&lt;/P&gt;&lt;PRE&gt;WHERE MyLabel == &lt;STRONG&gt;token&lt;/STRONG&gt;.MyLabel&lt;/PRE&gt;&lt;P&gt;by&lt;/P&gt;&lt;PRE&gt;WHERE MyLabel == &lt;STRONG&gt;puller&lt;/STRONG&gt;.MyLabel&lt;/PRE&gt;&lt;P&gt;and your model should work.&lt;/P&gt;&lt;P&gt;&lt;EM&gt;That solves your problem, you can continue reading for just a bit more background about puller vs. token.&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;If you look two fields below the query, you'll see that in this query, puller refers to token. Why this split? I think this is one of the main reasons:&lt;/P&gt;&lt;P&gt;Push To List and Pull to List are made to work together. When a token enters a Pull or Push, it will (usually) sit there until a matching token enters a Push or Pull, respectively. In principle, these activities sit in different flows that don't communicate with each other, but you &lt;EM&gt;can&lt;/EM&gt; pass a bit of information. For example: when the pull succeeds, the &lt;EM&gt;pulling &lt;/EM&gt;token doesn't just create a label with a reference to the pulled value -- the &lt;EM&gt;pushing &lt;/EM&gt;token, that gets released from the Push To List activity at that point, is assigned a label referencing the pulling token.&lt;/P&gt;&lt;P&gt;So in your model, in the PF on the right you will get token.pulled referencing the token on the left; and in the PF on the left you will get token.puller referencing the token on the right. Typically, in an application of orders and operators, for example, this allows you to know on the operator side which order was assigned, but also on the order side which order picker operator pulled it.&lt;/P&gt;&lt;P&gt;Sometimes, when you pull from a list, you may not want yourself to be set as the &lt;EM&gt;puller&lt;/EM&gt; on the value that you pull. By changing the &lt;EM&gt;puller&lt;/EM&gt; in your pull query, you can pass more useful information in some circumstances: for example, instead of "the token with id: 5" you can make the puller equal to an operator or rack in 3D, or if you have a child token in a subflow to do the pull action, you can set the puller equal to a parent token to preserve the information after the subflow ends.&lt;/P&gt;&lt;/DIV&gt;</description>
    <pubDate>Fri, 14 Aug 2020 10:44:42 GMT</pubDate>
    <dc:creator>mischa_spelt</dc:creator>
    <dc:date>2020-08-14T10:44:42Z</dc:date>
    <item>
      <title>How to query Lists for entries by fields from Label</title>
      <link>https://forums.autodesk.com/t5/flexsim-forum/how-to-query-lists-for-entries-by-fields-from-label/m-p/13514089#M26470</link>
      <description>&lt;P&gt;&lt;I&gt;[ FlexSim 20.1.0 ]&lt;/I&gt;&lt;/P&gt;&lt;DIV class="fr-view clearfix"&gt;
 &lt;P&gt;Hi, I try to pull entries from a partition of a list.&lt;BR /&gt;The query i want to use should match match a value from a label on the pulling token to a field from the list. &lt;BR /&gt;Just like this:&lt;/P&gt;
 &lt;PRE&gt;WHERE MyLabel == token.MyLabel&lt;/PRE&gt;
 &lt;P&gt;In the model attached I tried to do it with the logic bricks. I know that doesn't work as the assign label brick uses variant instead of string datatype.&lt;BR /&gt;But it shows what I try to do.&lt;BR /&gt;&lt;BR /&gt;If i custom code it to make sure its a string value, it doesn't throw an error but just acts like there was no match in the list - which is not the case.&lt;BR /&gt;&lt;BR /&gt;If i hardcode the query to:&lt;/P&gt;
 &lt;PRE&gt;WHERE MyLabel == "Direkt"&lt;/PRE&gt;
 &lt;P&gt;It works perfectly. But as soon as I try to use a label it just breaks.&lt;BR /&gt;I dug through all the questions here with similar topics, but i couldn't find an answer.&lt;/P&gt;
 &lt;P&gt;What am I doing wrong?&lt;A rel="noopener noreferrer" href="https://answers.flexsim.com/storage/attachments/31890-list-query.fsm" target="_blank"&gt;List query.fsm&lt;/A&gt;&lt;/P&gt;
&lt;/DIV&gt;</description>
      <pubDate>Fri, 14 Aug 2020 08:53:43 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/flexsim-forum/how-to-query-lists-for-entries-by-fields-from-label/m-p/13514089#M26470</guid>
      <dc:creator>philip_d2</dc:creator>
      <dc:date>2020-08-14T08:53:43Z</dc:date>
    </item>
    <item>
      <title>Re: How to query Lists for entries by fields from Label</title>
      <link>https://forums.autodesk.com/t5/flexsim-forum/how-to-query-lists-for-entries-by-fields-from-label/m-p/13514090#M26471</link>
      <description>&lt;DIV class="fr-view clearfix"&gt;&lt;P&gt;When you're using the Pull from List activity in Process Flow, you cannot use &lt;EM&gt;token&lt;/EM&gt; directly in the query.&lt;/P&gt;&lt;P&gt;Instead, you can reference an intermediary object called the &lt;EM&gt;puller. &lt;/EM&gt;By default, the puller &lt;STRONG&gt;is&lt;/STRONG&gt; equal to the token that is performing the query, so you can just replace&lt;/P&gt;&lt;PRE&gt;WHERE MyLabel == &lt;STRONG&gt;token&lt;/STRONG&gt;.MyLabel&lt;/PRE&gt;&lt;P&gt;by&lt;/P&gt;&lt;PRE&gt;WHERE MyLabel == &lt;STRONG&gt;puller&lt;/STRONG&gt;.MyLabel&lt;/PRE&gt;&lt;P&gt;and your model should work.&lt;/P&gt;&lt;P&gt;&lt;EM&gt;That solves your problem, you can continue reading for just a bit more background about puller vs. token.&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;If you look two fields below the query, you'll see that in this query, puller refers to token. Why this split? I think this is one of the main reasons:&lt;/P&gt;&lt;P&gt;Push To List and Pull to List are made to work together. When a token enters a Pull or Push, it will (usually) sit there until a matching token enters a Push or Pull, respectively. In principle, these activities sit in different flows that don't communicate with each other, but you &lt;EM&gt;can&lt;/EM&gt; pass a bit of information. For example: when the pull succeeds, the &lt;EM&gt;pulling &lt;/EM&gt;token doesn't just create a label with a reference to the pulled value -- the &lt;EM&gt;pushing &lt;/EM&gt;token, that gets released from the Push To List activity at that point, is assigned a label referencing the pulling token.&lt;/P&gt;&lt;P&gt;So in your model, in the PF on the right you will get token.pulled referencing the token on the left; and in the PF on the left you will get token.puller referencing the token on the right. Typically, in an application of orders and operators, for example, this allows you to know on the operator side which order was assigned, but also on the order side which order picker operator pulled it.&lt;/P&gt;&lt;P&gt;Sometimes, when you pull from a list, you may not want yourself to be set as the &lt;EM&gt;puller&lt;/EM&gt; on the value that you pull. By changing the &lt;EM&gt;puller&lt;/EM&gt; in your pull query, you can pass more useful information in some circumstances: for example, instead of "the token with id: 5" you can make the puller equal to an operator or rack in 3D, or if you have a child token in a subflow to do the pull action, you can set the puller equal to a parent token to preserve the information after the subflow ends.&lt;/P&gt;&lt;/DIV&gt;</description>
      <pubDate>Fri, 14 Aug 2020 10:44:42 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/flexsim-forum/how-to-query-lists-for-entries-by-fields-from-label/m-p/13514090#M26471</guid>
      <dc:creator>mischa_spelt</dc:creator>
      <dc:date>2020-08-14T10:44:42Z</dc:date>
    </item>
    <item>
      <title>Re: How to query Lists for entries by fields from Label</title>
      <link>https://forums.autodesk.com/t5/flexsim-forum/how-to-query-lists-for-entries-by-fields-from-label/m-p/13514091#M26472</link>
      <description>&lt;DIV class="fr-view clearfix"&gt;
 &lt;P&gt;Hi Mischa&lt;BR /&gt;Thanks a lot!&lt;BR /&gt;&lt;BR /&gt;I even knew what you stated in your explanation, but I would just have never guessed that the reference does not work like everywhere else in the software ^^. &lt;BR /&gt;&lt;BR /&gt;Thanks again, I would never have guessed that as I thought in this case puller / token would be interchangable. &lt;BR /&gt;&lt;BR /&gt;In cases like this i would be more than thankful if I could just click on the code icon to examine what the generated code looks like. In that case it would have been completely obvious that the reference is build using the puller variable. &lt;BR /&gt;Maybe in one of the next versions?&lt;BR /&gt;&lt;BR /&gt;Thanks again.&lt;BR /&gt;Phil&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;
&lt;/DIV&gt;</description>
      <pubDate>Fri, 14 Aug 2020 11:37:38 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/flexsim-forum/how-to-query-lists-for-entries-by-fields-from-label/m-p/13514091#M26472</guid>
      <dc:creator>philip_d2</dc:creator>
      <dc:date>2020-08-14T11:37:38Z</dc:date>
    </item>
  </channel>
</rss>

