{"id":20451,"date":"2022-09-15T16:13:11","date_gmt":"2022-09-15T14:13:11","guid":{"rendered":"https:\/\/help.openbee.com\/open-bee-portal\/administrators-guide\/sql-connectivity-module\/sql-queries\/self-populated-list\/"},"modified":"2026-05-13T10:47:51","modified_gmt":"2026-05-13T08:47:51","slug":"self-populated-list","status":"publish","type":"page","link":"https:\/\/help.openbee.com\/en\/open-bee-portal\/administrators-guide\/sql-connectivity-module\/sql-queries\/self-populated-list\/","title":{"rendered":"Self-Populated List"},"content":{"rendered":"\n<p>You can create lists that are self-populated by a SQL query.<br\/>The point is to have lists that are self-populated by another repository and synchronized.<\/p>\n\n<p>To insure synchronization at each use, the list will not directly contain the values reported by the query.<br\/>This is because the values in the list will be overloaded each time the query is executed, i.e. when a document is classified or metadata is modified.<\/p>\n\n<p>First, please create a List metadata with a list of at least one value.<br\/>This value doesn&#8217;t matter, it will be overridden by the result of the query.<\/p>\n\n<figure class=\"wp-block-image\"><img decoding=\"async\" src=\"https:\/\/help.openbee.com\/wp-content\/uploads\/2026\/03\/273355727-translated.png\" alt=\"\"\/><\/figure>\n\n<p>Please note that the metadata must not be &#8221; <strong>Multiple<\/strong>&#8220;.<\/p>\n\n<p>Next, you need to set up the SQL query.<br\/>In order for the query to be executed automatically, we&#8217;re not going to show any metadata in the WHERE clause.<br\/>If the list in our repository contains duplicates, we can use the SQL keyword &#8220;DISTINCT&#8221;.<br\/>In the association between the SQL column and the metadata, we use our Manager metadata, which is associated with the Handlers list created above.<\/p>\n\n<figure class=\"wp-block-image\"><img decoding=\"async\" src=\"https:\/\/help.openbee.com\/wp-content\/uploads\/2026\/03\/273355728-translated.png\" alt=\"\"\/><\/figure>\n\n<p>We can test how it works with the filing of a document.<br\/>By choosing the Insurance Managers ranking rule in our example, the Manager list is indeed self-populated by the SQL query.<\/p>\n\n<figure class=\"wp-block-image\"><img decoding=\"async\" src=\"https:\/\/help.openbee.com\/wp-content\/uploads\/2026\/03\/273355729-translated.png\" alt=\"\"\/><\/figure>\n","protected":false},"excerpt":{"rendered":"<p>You can create lists that are self-populated by a SQL query.The point is to have lists that are self-populated by another repository and synchronized. To insure synchronization at each use, the list will not directly contain the values reported by the query.This is because the values in the list will be overloaded each time the [&hellip;]<\/p>\n","protected":false},"author":4,"featured_media":0,"parent":20447,"menu_order":1,"comment_status":"closed","ping_status":"closed","template":"templates\/ob-help-products.php","meta":{"footnotes":""},"class_list":["post-20451","page","type-page","status-publish","hentry"],"_links":{"self":[{"href":"https:\/\/help.openbee.com\/en\/wp-json\/wp\/v2\/pages\/20451","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/help.openbee.com\/en\/wp-json\/wp\/v2\/pages"}],"about":[{"href":"https:\/\/help.openbee.com\/en\/wp-json\/wp\/v2\/types\/page"}],"author":[{"embeddable":true,"href":"https:\/\/help.openbee.com\/en\/wp-json\/wp\/v2\/users\/4"}],"replies":[{"embeddable":true,"href":"https:\/\/help.openbee.com\/en\/wp-json\/wp\/v2\/comments?post=20451"}],"version-history":[{"count":6,"href":"https:\/\/help.openbee.com\/en\/wp-json\/wp\/v2\/pages\/20451\/revisions"}],"predecessor-version":[{"id":38746,"href":"https:\/\/help.openbee.com\/en\/wp-json\/wp\/v2\/pages\/20451\/revisions\/38746"}],"up":[{"embeddable":true,"href":"https:\/\/help.openbee.com\/en\/wp-json\/wp\/v2\/pages\/20447"}],"wp:attachment":[{"href":"https:\/\/help.openbee.com\/en\/wp-json\/wp\/v2\/media?parent=20451"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}