# Error\_CycleDetected help on an if expression

**URL:** <https://forum.inductiveautomation.com/t/error-cycledetected-help-on-an-if-expression/44157>\
**Category:** Ignition\
**Tags:** perspective\
**Created:** [March 5, 2021, 3:40pm UTC](https://forum.inductiveautomation.com/t/error-cycledetected-help-on-an-if-expression/44157 "2021-03-05T15:40:46Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![dholt](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/dholt/32/4458_2.png) [@dholt](https://forum.inductiveautomation.com/u/dholt)\
**Post date:** [March 5, 2021, 3:40pm UTC](https://forum.inductiveautomation.com/t/error-cycledetected-help-on-an-if-expression/44157/1 "2021-03-05T15:40:47Z")

</div>

Greetings!  
I am trying to allow users the ability to “Select all that apply” and trying to convert this into a string for SQL insert using an if Expression on a text box in perspective. I have multiple Select boxes on the screen and would like the users to select everything that would be a keyword they want attached as a way to have a curated list with some flexibility on selection. In the text area, I’ve started working with a nested if statement on the text binding on the text area itself. I’m getting an error titled “Data Quality : Error\_CycleDetected” and I’m not sure what that means. Any smart people able to help this dumb guy out?

[Image](https://i.imgur.com/QqOokaL.jpg)

Script I’m using:

```auto
if({../Checkbox.props.selected}=1,
	concat({this.props.text},'SQL,'),
	if({../Checkbox_0.props.selected}=1,
		concat({this.props.text},'Ignition,'),
	''))

```

Thanks in advance guys/gals!

---

<div class="post-metadata">

**Author:** ![schenk](https://avatars.discourse-cdn.com/v4/letter/s/6bbea6/32.png) [@schenk](https://forum.inductiveautomation.com/u/schenk)\
**Post date:** [March 6, 2021, 4:28pm UTC](https://forum.inductiveautomation.com/t/error-cycledetected-help-on-an-if-expression/44157/2 "2021-03-06T16:28:07Z")

</div>

It looks like you’ve created a circular reference on the text property by binding it to itself. You can build the string by binding it to something like this:

```auto
if({../Checkbox.props.selected}, {../Checkbox.props.text}+',', '') +
if({../Checkbox_0.props.selected}, {../Checkbox_0.props.text}+',', '') +
if({../Checkbox_1.props.selected}, {../Checkbox_1.props.text}+',', '') +
if({../Checkbox_2.props.selected}, {../Checkbox_2.props.text}+',', '') +
...

```

---

<div class="post-metadata">

**Author:** ![dholt](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/dholt/32/4458_2.png) [@dholt](https://forum.inductiveautomation.com/u/dholt)\
**Post date:** [March 10, 2021, 9:15am UTC](https://forum.inductiveautomation.com/t/error-cycledetected-help-on-an-if-expression/44157/3 "2021-03-10T09:15:55Z")

</div>

My man! Thank you kindly! I appreciate the help!
