# Setting element parameter using conditional IF statement only works for TRUE

**URL:** <https://forum.dynamobim.com/t/setting-element-parameter-using-conditional-if-statement-only-works-for-true/90540>\
**Category:** Revit\
**Tags:** revit, dynamo\
**Created:** [June 9, 2023, 6:34am UTC](https://forum.dynamobim.com/t/setting-element-parameter-using-conditional-if-statement-only-works-for-true/90540 "2023-06-09T06:34:06Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![eslam.abdo.taha](https://avatars.discourse-cdn.com/v4/letter/e/5daacb/32.png) [@eslam.abdo.taha](https://forum.dynamobim.com/u/eslam.abdo.taha)\
**Post date:** [June 9, 2023, 6:34am UTC](https://forum.dynamobim.com/t/setting-element-parameter-using-conditional-if-statement-only-works-for-true/90540/1 "2023-06-09T06:34:06Z")

</div>

Hello,  
I want to be able to set element parameter using a conditional IF statement but the script is not working properly.

It always set the element parameter as if it’s true, regardless of the test result.

 ![cable-tray-size-checker_2023-06-09_09-27-38](https://us1.discourse-cdn.com/flex022/uploads/dynamobim/original/3X/4/f/4f70fff5772115980f8e997e1e2b2c874687b94d.png)

---

<div class="post-metadata">

**Author:** ![sovitek](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/sovitek/32/116237_2.png) [@sovitek](https://forum.dynamobim.com/u/sovitek)\
**Post date:** [June 9, 2023, 7:25am UTC](https://forum.dynamobim.com/t/setting-element-parameter-using-conditional-if-statement-only-works-for-true/90540/2 "2023-06-09T07:25:46Z")

</div>

Hi @eslam.abdo.taha difficult to see your image…anyway try with scopeif or something here…

 ![Capture](https://us1.discourse-cdn.com/flex022/uploads/dynamobim/original/3X/3/5/35745a7b45450acb393b9c84cf9921ad55c59658.png)

 ![Capture](https://us1.discourse-cdn.com/flex022/uploads/dynamobim/original/3X/4/f/4faf7dd3a620344ac1383fec02f757f144b2a4cb.png)

---

<div class="post-metadata">

**Author:** ![eslam.abdo.taha](https://avatars.discourse-cdn.com/v4/letter/e/5daacb/32.png) [@eslam.abdo.taha](https://forum.dynamobim.com/u/eslam.abdo.taha)\
**Post date:** [June 9, 2023, 8:49am UTC](https://forum.dynamobim.com/t/setting-element-parameter-using-conditional-if-statement-only-works-for-true/90540/3 "2023-06-09T08:49:43Z")

</div>

Thanks for your reply. but I tried those and I still get the same result.  
I want to use the conditional if statement node to set a certain parameter value according to a boolean test.  
If the test is true then the parameter value should be a certain text value.  
If the test is false then another text value should be written in that parameter.  
what happens is whether the test was true or false, the answer is the same and doesn’t change.

I am suspecting that the problem is with the parameter itself that it doesn’t auto-update when I re-run the script and keeps the same value stored forever.

---

<div class="post-metadata">

**Author:** ![sovitek](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/sovitek/32/116237_2.png) [@sovitek](https://forum.dynamobim.com/u/sovitek)\
**Post date:** [June 9, 2023, 8:52am UTC](https://forum.dynamobim.com/t/setting-element-parameter-using-conditional-if-statement-only-works-for-true/90540/4 "2023-06-09T08:52:02Z")

</div>

Hi could you share your file

---

<div class="post-metadata">

**Author:** ![staylor](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/staylor/32/94307_2.png) [@staylor](https://forum.dynamobim.com/u/staylor)\
**Post date:** [June 9, 2023, 3:14pm UTC](https://forum.dynamobim.com/t/setting-element-parameter-using-conditional-if-statement-only-works-for-true/90540/5 "2023-06-09T15:14:34Z")

</div>

If I’m seeing your graph correctly, you have the If statement in the wrong location. Use the If statement to sort the two strings “Size is good” true input and “Size must be increased” false input. Then feed the result of the if statement into the value input of the Set Parameter Value node. Use the ScopeIf+ node so you can set the lacing if needed.

 ![image](https://us1.discourse-cdn.com/flex022/uploads/dynamobim/original/3X/2/8/2814c57d193cf4b24ad77d9c750a81da36d48cfb.png)

---

<div class="post-metadata">

**Author:** ![eslam.abdo.taha](https://avatars.discourse-cdn.com/v4/letter/e/5daacb/32.png) [@eslam.abdo.taha](https://forum.dynamobim.com/u/eslam.abdo.taha)\
**Post date:** [June 9, 2023, 3:52pm UTC](https://forum.dynamobim.com/t/setting-element-parameter-using-conditional-if-statement-only-works-for-true/90540/6 "2023-06-09T15:52:08Z")

</div>

Thanks for your time and effort. the problem was solved.

---

<div class="post-metadata">

**Author:** ![eslam.abdo.taha](https://avatars.discourse-cdn.com/v4/letter/e/5daacb/32.png) [@eslam.abdo.taha](https://forum.dynamobim.com/u/eslam.abdo.taha)\
**Post date:** [June 9, 2023, 3:53pm UTC](https://forum.dynamobim.com/t/setting-element-parameter-using-conditional-if-statement-only-works-for-true/90540/7 "2023-06-09T15:53:20Z")

</div>

Thank you very much. That solved it.
