{"id":2148,"date":"2016-05-08T08:57:51","date_gmt":"2016-05-08T08:57:51","guid":{"rendered":"https:\/\/poiseddevelopers.com\/reality-tech\/?p=2148"},"modified":"2024-04-11T11:26:59","modified_gmt":"2024-04-11T11:26:59","slug":"incrementing-repeating-table-field-values","status":"publish","type":"post","link":"https:\/\/poiseddevelopers.com\/reality-tech\/incrementing-repeating-table-field-values\/","title":{"rendered":"Incrementing repeating table field values"},"content":{"rendered":"<h3>How to increment a field for new rows added into a repeating table in InfoPath<\/h3>\n<p>It is really helpful to users to incrementally auto-populate newly added rows. In InfoPath, XPath is used to specify calculated values. To count the number of rows that exist, we can use the following expression:<\/p>\n<pre lang=\"php\"> \r\ncount(..\/preceding-sibling::*)\r\n<\/pre>\n<p>This returns the 0 based count of existing rows. First row would be zero. To get a one-based count, simply use:<\/p>\n<pre lang=\"php\"> \r\ncount(..\/preceding-sibling::*)+1\r\n<\/pre>\n<p>What if you want to have letters that increase? One way is to use the XPath translate(0 function such as:<\/p>\n<pre lang=\"php\"> \r\ntranslate(count(..\/preceding-sibling::*), \"012345\", \"ABCDEF\")\r\n<\/pre>\n","protected":false},"excerpt":{"rendered":"<p>How to increment a field for new rows added into a repeating table in InfoPath It is really helpful to users to incrementally auto-populate newly added rows. In InfoPath, XPath is used to specify calculated values. To count the number of rows that exist, we can use the following expression: count(..\/preceding-sibling::*) This returns the 0 [&hellip;]<\/p>\n","protected":false},"author":2,"featured_media":2149,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[51],"tags":[],"class_list":["post-2148","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-infopath"],"acf":[],"_links":{"self":[{"href":"https:\/\/poiseddevelopers.com\/reality-tech\/wp-json\/wp\/v2\/posts\/2148","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/poiseddevelopers.com\/reality-tech\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/poiseddevelopers.com\/reality-tech\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/poiseddevelopers.com\/reality-tech\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/poiseddevelopers.com\/reality-tech\/wp-json\/wp\/v2\/comments?post=2148"}],"version-history":[{"count":1,"href":"https:\/\/poiseddevelopers.com\/reality-tech\/wp-json\/wp\/v2\/posts\/2148\/revisions"}],"predecessor-version":[{"id":2150,"href":"https:\/\/poiseddevelopers.com\/reality-tech\/wp-json\/wp\/v2\/posts\/2148\/revisions\/2150"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/poiseddevelopers.com\/reality-tech\/wp-json\/wp\/v2\/media\/2149"}],"wp:attachment":[{"href":"https:\/\/poiseddevelopers.com\/reality-tech\/wp-json\/wp\/v2\/media?parent=2148"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/poiseddevelopers.com\/reality-tech\/wp-json\/wp\/v2\/categories?post=2148"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/poiseddevelopers.com\/reality-tech\/wp-json\/wp\/v2\/tags?post=2148"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}