# OPTIONINDEX Example in Dynamic Pricing has "Delay" Problem

**URL:** <https://forums.sketchup.com/t/optionindex-example-in-dynamic-pricing-has-delay-problem/9761>\
**Category:** Dynamic Components\
**Created:** [April 7, 2015, 6:35pm UTC](https://forums.sketchup.com/t/optionindex-example-in-dynamic-pricing-has-delay-problem/9761 "2015-04-07T18:35:03Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![jorenste](https://sea2.discourse-cdn.com/sketchup/user_avatar/forums.sketchup.com/jorenste/32/82675_2.png) [@jorenste](https://forums.sketchup.com/u/jorenste)\
**Post date:** [April 7, 2015, 6:35pm UTC](https://forums.sketchup.com/t/optionindex-example-in-dynamic-pricing-has-delay-problem/9761/1 "2015-04-07T18:35:03Z")

</div>

The example using OPTIONINDEX in the Knowledge Center article [Implement dynamic pricing | SketchUp Help](http://help.sketchup.com/en/article/114564) (Implement dynamic pricing) doesn’t work properly for me (SU 2015, Windows 7 64 bit, IE 11 update version 11.0.17); OPTIONINDEX appears to return the value for the previous entry instead of the current one. As an example, I added the attribute “Index” to the example optionindex\_function.skp; see attached file optionindex\_function\_delay.skp.[optionindex\_function\_delay.skp](https://forums.sketchup.com/uploads/default/5498/1ebc1f0416946276.skp) (539.4 KB) .

Is this a known problem, & is there a workaround (other than using multiple “ifs”)? Same seems to hold for OPTIONLABEL.

If this is a known problem, I recommend you update the examples, so others don’t spend the time required to investigate this (learning experience notwithstanding).

Thanks & sorry if I missed any previous answers.

James

---

<div class="post-metadata">

**Author:** ![jorenste](https://sea2.discourse-cdn.com/sketchup/user_avatar/forums.sketchup.com/jorenste/32/82675_2.png) [@jorenste](https://forums.sketchup.com/u/jorenste)\
**Post date:** [April 7, 2015, 8:03pm UTC](https://forums.sketchup.com/t/optionindex-example-in-dynamic-pricing-has-delay-problem/9761/2 "2015-04-07T20:03:39Z")

</div>

I don’t know if its bad form to reply to myself before anyone else does, but…

I found a similar problem in another post, where it was a secondary issue (OPTIONLABEL(“material”) shows “delay”) to primary issue of OPTIONLABEL(“LenZ”) not working: [OPTIONLABEL fails for LenZ](http://forums.sketchup.com/t/optionlabel-fails-for-lenz/8036) .

However, the fix there (as I understand it, using an intermediate variable) appears to solve my problem also: [optionindex\_function\_delay\_workaround.skp](https://forums.sketchup.com/uploads/default/5505/a22ef1f9de5a4a59.skp) (540.8 KB) .

I assume this has something to do with “order of calculation”, & would still like a more elegant fix if anyone finds one.

James

---

<div class="post-metadata">

**Author:** ![pcmoor](https://sea2.discourse-cdn.com/sketchup/user_avatar/forums.sketchup.com/pcmoor/32/3427_2.png) [@pcmoor](https://forums.sketchup.com/u/pcmoor)\
**Post date:** [April 8, 2015, 1:31am UTC](https://forums.sketchup.com/t/optionindex-example-in-dynamic-pricing-has-delay-problem/9761/3 "2015-04-08T01:31:16Z")

</div>

the article is incorrect, first it shows cherry as the first in the list

then later it claims cork is first and cherry is second

---

<div class="post-metadata">

**Author:** ![filippo\_scarso](https://sea2.discourse-cdn.com/sketchup/user_avatar/forums.sketchup.com/filippo_scarso/32/206603_2.png) [@filippo\_scarso](https://forums.sketchup.com/u/filippo_scarso)\
**Post date:** [May 22, 2019, 9:13am UTC](https://forums.sketchup.com/t/optionindex-example-in-dynamic-pricing-has-delay-problem/9761/4 "2019-05-22T09:13:27Z")

</div>

Hi! I’m encountering the same issue, I’d like to solve this but seems like I’m not able to download the skp file anymore.  
Can anybody point me to the solution’ thanks in advance!

---

<div class="post-metadata">

**Author:** ![fbonomo](https://sea2.discourse-cdn.com/sketchup/user_avatar/forums.sketchup.com/fbonomo/32/150149_2.png) [@fbonomo](https://forums.sketchup.com/u/fbonomo)\
**Post date:** [August 8, 2022, 7:46pm UTC](https://forums.sketchup.com/t/optionindex-example-in-dynamic-pricing-has-delay-problem/9761/6 "2022-08-08T19:46:31Z")

</div>

The issue in the example [[Implement dynamic pricing | SketchUp Help](https://help.sketchup.com/en/sketchup/implement-dynamic-pricing)] seems to be related to the predefined Material attribute. I don’t know what causes this, perhaps something related to its only being text-based.

A workaround to use the CHOOSE(OPTIONINDEX) function combination is to allow users to select a material from a custom attribute (ex. mat) AND generate a calculated result from that attribute index value. Then separately let the Material attribute get its value from the custom attribute’s text value.

See attached ex.

[Implement dynamic pricing.skp](https://forums.sketchup.com/uploads/short-url/5n4RYjj04z3ytWZ1wzzpFMW2CAA.skp) (37.8 KB)
