Skip to main content

Hello,

why the result of this setup is TRUE?

 

Thank you

Hey ​@dean.hubak, I’m able to reproduce what you see. I can prevent that from happening by adding another condition in the IF -- checking that the order number is not blank.

That’s quite interesting and it must be something in the way we’re checking for the position of the string. I tried that in PHP, Python, and JavaScript, and they all returned “false”, but I was using strpos(), index(), and indexOf() respectively in my code.


Thank you ​@Aaron.Gleason 

But the problem is that OrderNumber can be also blank. So, any combination of those two checked data is possible. ProjectNumber could be empty, OrderNumber also.

 

Your solution gives the proper result only if OrderNumber is not empty. 

Are you suggesting that before final check (one variable contains the value of the second one, or vice versa) we have to check weather are those variables empty or not so we can be sure that final IF (with “includes” condition) is working properly?!? That makes no sense...

 

 

 

 


@dean.hubak Yeah, not an ideal solution. I think you would be best served by a nested IF like this:

if ($sProjectNumber$ != "" && $sOrderNumber$ != "") {
if ($sProjectNumber$ includes $sOrderNumber$) {
//do something
}
}

Sorry for my pseudo-code. 😁


@dean.hubak Yeah, not an ideal solution. I think you would be best served by a nested IF like this:

if ($sProjectNumber$ != "" && $sOrderNumber$ != "") {
if ($sProjectNumber$ includes $sOrderNumber$) {
//do something
}
}

Sorry for my pseudo-code. 😁

...just another of AA quirks, right…

 

But I guess it will be necessary tu put more than just one nested IF because this is only if ProjectNumber AND OrderNumber are both blank. The combination of one of them blanked need more IFs


@dean.hubak That is an interesting one you found. Yeah, pretty much every language has its idiosyncrasies. At least we don’t throw a syntax error if you mix tabs and spaces... (I’m looking at you, Python!)  🤣🐍

 


Hi ​@dean.hubak,

 

It may sound weird, but instead of passing a blank value to the OrderNumber, just put a space as its input and try once. Somehow, AA is not treating the empty value as empty, but putting a space will do the trick. 

So in your actual scenario, you may need to replace the empty value by adding a space to it. 

 

 


Hi ​@dean.hubak,

 

It may sound weird, but instead of passing a blank value to the OrderNumber, just put a space as its input and try once. Somehow, AA is not treating the empty value as empty, but putting a space will do the trick. 

So in your actual scenario, you may need to replace the empty value by adding a space to it. 

 

 

@Padmakumar thank you for the reply

 

However...that will mess up the actual checking. If ProjectNumber contains “ “ (space) in any part of the string it would give a misleading/wrong result - in other words, I dont want to check if the ProjectNumber includes a “space” from OrderNumber.

This simple part of a code is just a part of much wider problem because we are focusing only on this particular case and not considering all other combinations of those two variables. The only solution is to go with (I dont know how many) IFs/nested IFs to first check the two variables, correct if there are empty values and etc. etc etc...And all that with considering all possible combinations of those variables. 

 

Another problem is...what if there are >2 variables to be checked...you can see where this is going.

I think it’s a serious bug!

I’m on this platform for just a couple of months and this is not the only thing I came across that I had to find some crazy and unnecessary workaround. 

 


Hi ​@dean.hubak,

 

It may sound weird, but instead of passing a blank value to the OrderNumber, just put a space as its input and try once. Somehow, AA is not treating the empty value as empty, but putting a space will do the trick. 

So in your actual scenario, you may need to replace the empty value by adding a space to it. 

 

 

@Padmakumar thank you for the reply

 

However...that will mess up the actual checking. If ProjectNumber contains “ “ (space) in any part of the string it would give a misleading/wrong result - in other words, I dont want to check if the ProjectNumber includes a “space” from OrderNumber.

This simple part of a code is just a part of much wider problem because we are focusing only on this particular case and not considering all other combinations of those two variables. The only solution is to go with (I dont know how many) IFs/nested IFs to first check the two variables, correct if there are empty values and etc. etc etc...And all that with considering all possible combinations of those variables. 

 

Another problem is...what if there are >2 variables to be checked...you can see where this is going.

I think it’s a serious bug!

I’m on this platform for just a couple of months and this is not the only thing I came across that I had to find some crazy and unnecessary workaround. 

 

Hi ​@dean.hubak,

 

It may sound weird, but instead of passing a blank value to the OrderNumber, just put a space as its input and try once. Somehow, AA is not treating the empty value as empty, but putting a space will do the trick. 

So in your actual scenario, you may need to replace the empty value by adding a space to it. 

 

 

@Padmakumar thank you for the reply

 

However...that will mess up the actual checking. If ProjectNumber contains “ “ (space) in any part of the string it would give a misleading/wrong result - in other words, I dont want to check if the ProjectNumber includes a “space” from OrderNumber.

This simple part of a code is just a part of much wider problem because we are focusing only on this particular case and not considering all other combinations of those two variables. The only solution is to go with (I dont know how many) IFs/nested IFs to first check the two variables, correct if there are empty values and etc. etc etc...And all that with considering all possible combinations of those variables. 

 

Another problem is...what if there are >2 variables to be checked...you can see where this is going.

I think it’s a serious bug!

I’m on this platform for just a couple of months and this is not the only thing I came across that I had to find some crazy and unnecessary workaround. 

 

As long as you are trimming the ProjectNumber value, the chances of including space won't be an issue, as per my understanding (if the Project number always follow the mentioned format)


Hi ​@dean.hubak,

 

It may sound weird, but instead of passing a blank value to the OrderNumber, just put a space as its input and try once. Somehow, AA is not treating the empty value as empty, but putting a space will do the trick. 

So in your actual scenario, you may need to replace the empty value by adding a space to it. 

 

 

@Padmakumar thank you for the reply

 

However...that will mess up the actual checking. If ProjectNumber contains “ “ (space) in any part of the string it would give a misleading/wrong result - in other words, I dont want to check if the ProjectNumber includes a “space” from OrderNumber.

This simple part of a code is just a part of much wider problem because we are focusing only on this particular case and not considering all other combinations of those two variables. The only solution is to go with (I dont know how many) IFs/nested IFs to first check the two variables, correct if there are empty values and etc. etc etc...And all that with considering all possible combinations of those variables. 

 

Another problem is...what if there are >2 variables to be checked...you can see where this is going.

I think it’s a serious bug!

I’m on this platform for just a couple of months and this is not the only thing I came across that I had to find some crazy and unnecessary workaround. 

 

Hi ​@dean.hubak,

 

It may sound weird, but instead of passing a blank value to the OrderNumber, just put a space as its input and try once. Somehow, AA is not treating the empty value as empty, but putting a space will do the trick. 

So in your actual scenario, you may need to replace the empty value by adding a space to it. 

 

 

@Padmakumar thank you for the reply

 

However...that will mess up the actual checking. If ProjectNumber contains “ “ (space) in any part of the string it would give a misleading/wrong result - in other words, I dont want to check if the ProjectNumber includes a “space” from OrderNumber.

This simple part of a code is just a part of much wider problem because we are focusing only on this particular case and not considering all other combinations of those two variables. The only solution is to go with (I dont know how many) IFs/nested IFs to first check the two variables, correct if there are empty values and etc. etc etc...And all that with considering all possible combinations of those variables. 

 

Another problem is...what if there are >2 variables to be checked...you can see where this is going.

I think it’s a serious bug!

I’m on this platform for just a couple of months and this is not the only thing I came across that I had to find some crazy and unnecessary workaround. 

 

As long as you are trimming the ProjectNumber value, the chances of including space won't be an issue, as per my understanding (if the Project number always follow the mentioned format)

Again...this case is just an example...just one of many combinations of what we all can encounter to in many of our projects outside this example - variables with space at the end, variables with space in the middle of the string, variables empty, more than 2 variables...all those combinations require a special set of IF’s/nested IF’s because of this


Hi ​@dean.hubak,

 

It may sound weird, but instead of passing a blank value to the OrderNumber, just put a space as its input and try once. Somehow, AA is not treating the empty value as empty, but putting a space will do the trick. 

So in your actual scenario, you may need to replace the empty value by adding a space to it. 

 

 

@Padmakumar thank you for the reply

 

However...that will mess up the actual checking. If ProjectNumber contains “ “ (space) in any part of the string it would give a misleading/wrong result - in other words, I dont want to check if the ProjectNumber includes a “space” from OrderNumber.

This simple part of a code is just a part of much wider problem because we are focusing only on this particular case and not considering all other combinations of those two variables. The only solution is to go with (I dont know how many) IFs/nested IFs to first check the two variables, correct if there are empty values and etc. etc etc...And all that with considering all possible combinations of those variables. 

 

Another problem is...what if there are >2 variables to be checked...you can see where this is going.

I think it’s a serious bug!

I’m on this platform for just a couple of months and this is not the only thing I came across that I had to find some crazy and unnecessary workaround. 

 

Hi ​@dean.hubak,

 

It may sound weird, but instead of passing a blank value to the OrderNumber, just put a space as its input and try once. Somehow, AA is not treating the empty value as empty, but putting a space will do the trick. 

So in your actual scenario, you may need to replace the empty value by adding a space to it. 

 

 

@Padmakumar thank you for the reply

 

However...that will mess up the actual checking. If ProjectNumber contains “ “ (space) in any part of the string it would give a misleading/wrong result - in other words, I dont want to check if the ProjectNumber includes a “space” from OrderNumber.

This simple part of a code is just a part of much wider problem because we are focusing only on this particular case and not considering all other combinations of those two variables. The only solution is to go with (I dont know how many) IFs/nested IFs to first check the two variables, correct if there are empty values and etc. etc etc...And all that with considering all possible combinations of those variables. 

 

Another problem is...what if there are >2 variables to be checked...you can see where this is going.

I think it’s a serious bug!

I’m on this platform for just a couple of months and this is not the only thing I came across that I had to find some crazy and unnecessary workaround. 

 

As long as you are trimming the ProjectNumber value, the chances of including space won't be an issue, as per my understanding (if the Project number always follow the mentioned format)

Again...this case is just an example...just one of many combinations of what we all can encounter to in many of our projects outside this example - variables with space at the end, variables with space in the middle of the string, variables empty, more than 2 variables...all those combinations require a special set of IF’s/nested IF’s because of this

 

Ok. Here is another approach that you can try.

 

1. Create a Dictionary for Inputs

  • Action: Dictionary: Create
  • Name it dicInput.
  • Add keys for each variable:
    Key: "ProjectNumber" → Value: $ProjectNumber$
    Key: "OrderNumber" → Value: $OrderNumber$
    (Add more as needed)

2. Create Two Empty Dictionaries

  • dicLogic → for normalized values.
  • dicUI → for UI-safe values.

3. Loop Through Each Key

  • Action: Loop: For Each Key in Dictionary
    • Dictionary: dicInput
    • Current Key: $currentKey$

Inside the loop:

4. Normalize the Value

  • Action: String: Trim
    • Input: dicInput[$currentKey$]
    • Output: $normalizedValue$

5. Check if Empty

  • Action: If Condition
    • Condition: $normalizedValue$ = ""
      • Then:
        • Set $uiValue$ = " " (space)
      • Else:
        • Set $uiValue$ = $normalizedValue$

6. Store Results

  • Action: Dictionary: Set
    • dicLogic[$currentKey$] = $normalizedValue$
    • dicUI[$currentKey$] = $uiValue$

7. End Loop

How to Use Later

  • For logic checks: use dicLogic["ProjectNumber"] (clean, no spaces).
  • For UI typing: use dicUI["ProjectNumber"] (space if empty).

This handles:

  • Empty values.
  • Leading/trailing spaces.
  • Multiple variables (scales easily).
  • No nested IF nightmare.