Logmanager dokumentace
Přepnout tmavý/světlý/automatický režim Přepnout tmavý/světlý/automatický režim Přepnout tmavý/světlý/automatický režim Zpět na domovskou stránku

Dictionary get index

This section is available only in English

This block is used to obtain value for given key from dictionary. Left part defines the source dictionary. Right part defines the key, whose value we want to obtain. Block returns value of the key.

In case specified key does not exist block returns None. However this state should be fixed.

Block XML representation

XML representation of dictionaries_get_index block

<xml xmlns="http://www.w3.org/1999/xhtml">
  <block type="dictionaries_get_index">
    <mutation statement="false" at="true"/>
    <value name="VALUE">
      <block type="variables_get">
        <field name="VAR">dictionary</field>
      </block>
    </value>
    <value name="AT">
      <block type="text">
        <field name="TEXT">key</field>
      </block>
    </value>
  </block>
</xml>

Example of visual representation

Block "Dictionary get index"

Block “Dictionary get index”

Example of block usage

Example of "Dictionary get index" block

Example of “Dictionary get index” block

Block is used on the row “if in dictionary item” in the example. It reads the value of the “user” key in “item” dictionary. Value is compared with word “administrator” and if there is a match, new key “admin” with value “true” is saved into the “item” dictionary.

Processing result

Results of "Dictionary get index" block

Results of “Dictionary get index” block