{"id":21307,"date":"2022-04-11T13:56:08","date_gmt":"2022-04-11T11:56:08","guid":{"rendered":"https:\/\/help.openbee.com\/open-bee-scan-capture\/knowledge-base\/how-to-guides\/scripts-in-capture\/case-studies\/tricks\/tip-retrieving-the-value-of-an-index-from-the-id-and-idunit\/"},"modified":"2024-05-07T10:32:20","modified_gmt":"2024-05-07T08:32:20","slug":"tip-retrieving-the-value-of-an-index-from-the-id-and-idunit","status":"publish","type":"page","link":"https:\/\/help.openbee.com\/en\/open-bee-scan-capture\/knowledge-base\/how-to-guides\/scripts-in-capture\/case-studies\/tricks\/tip-retrieving-the-value-of-an-index-from-the-id-and-idunit\/","title":{"rendered":"Tip: Retrieving the value of an index from the ID and IDUnit"},"content":{"rendered":"\n<pre class=\"wp-block-code\"><code>var getIndexFromIDAndIDUnit = function(pParameters, idIndex, idUnit){\n\n\tvar listIndex = getIndexesFromID(pParameters, idIndex);\n\n\tif(listIndex != null){\n\t\tfor(var i=0;i&lt;listIndex.length;i++){\n\t\t\tif(listIndex&#91;i].idUnit == idUnit)\n\t\t\t\treturn getTextFromIndexInfo(listIndex&#91;i]);\n\t\t}\n\t}\n\treturn \"\";\n};<\/code><\/pre>\n\n\n\n<p><\/p>\n","protected":false},"excerpt":{"rendered":"","protected":false},"author":1,"featured_media":0,"parent":21272,"menu_order":4,"comment_status":"closed","ping_status":"closed","template":"templates\/ob-help-products.php","meta":{"footnotes":""},"class_list":["post-21307","page","type-page","status-publish","hentry"],"_links":{"self":[{"href":"https:\/\/help.openbee.com\/en\/wp-json\/wp\/v2\/pages\/21307","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\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/help.openbee.com\/en\/wp-json\/wp\/v2\/comments?post=21307"}],"version-history":[{"count":1,"href":"https:\/\/help.openbee.com\/en\/wp-json\/wp\/v2\/pages\/21307\/revisions"}],"predecessor-version":[{"id":21308,"href":"https:\/\/help.openbee.com\/en\/wp-json\/wp\/v2\/pages\/21307\/revisions\/21308"}],"up":[{"embeddable":true,"href":"https:\/\/help.openbee.com\/en\/wp-json\/wp\/v2\/pages\/21272"}],"wp:attachment":[{"href":"https:\/\/help.openbee.com\/en\/wp-json\/wp\/v2\/media?parent=21307"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}