Logic apps Condition 'Array contains string' evaluates to false when true is expected - conditional-statements

I'm having an issue with conditions checking if an array contains a certain value.
I added a debug object to see the values when running. The following is my logic app designer view:
When running, the condition always evaluates to false.
This is what the run details show:
As seen in the above snippet, the Title 'General' is contained in the 'Array', yet the condition evaluates to false.
Why is this happening?
EDIT: see my answer, was a visual bug with the logic app designer view

It was probably a visual bug with the logic app designer view. In code view I saw the following:
I added the rest of the expression and it worked:

Per my understanding, it is not a bug. In your first screenshot, according to the icon
the "Title" is not shown as a variable as your mentioned in your answer("#variables('Title')"), so it always return "false" in the "If" condition.
If you want to get "true" result in your first screenshot, you can change the Array to the expression below:
string(variables('Array'))

Related

AnyLogic - Why does my condition based transition not work?

I have a question related to a transition in my statechart (see image above). I have a variable called palletInUse which is a boolean-type and changes between true and false. For one transition in my statechart I want it to change when the variable palletInUse has the value true. I have tried it with for example:
palletInUse == true;
and also tried different code like, equals and contentEquals etc. but nothing seems to work. Do you have a solution for this, seemingly simple problem?
Thanks in advance
The condition is not monitored constantly, only when something is changed in the agent. When you assign a new value to variable with common "=" Java operator, it is not caught by the AnyLogic engine. You need to call onChange() function after that. Then, the transition should be executed.
There are other ways to trigger the condition check without explicit onChange() call. You may find them in AnyLogic Help article.
BTW, you may specify just boolean variable as the condition, it is not required to compare it with true or false:
palletInUse
The condition is not evaluated if nothing is happening, for that reason you have to make something happen constantly to have your condition evaluated. A typical way of doing is as you see in the following pictures:

Pentaho Report Design conditions

I want to put one condition for the columns in the report. I am passing a parameter called "TEMPLATE", I want to make some of the columns in report visible only if the values of passed parameter lies IN ["A","B",C","D"]. I am putting it like:
=IF([TEMPLATE]IN("A";"B";"C";"D";"E");TRUE();FALSE());
But it says syntax error every time and doesn't work. Can someone please help me in making it correct.
This is the correct syntax:
=IF(IN([TEMPLATE];"a";"b";"c");TRUE();FALSE())
where is
IN(<condition>;<sample1>;<sample2>;...)
returns true if <condition> equals to one of the <sampleX>. Otherwise return false.

Adobe Livecycle: how to get the value of process data

I have a process data defined in Adobe livecycle, addField as a string. I am passing the value of this variable as an input when i invoke a process. Further i want to compare the value of this process data if it is true or false. I am trying to use the following expression:
string(/process_data/#addField)=string("true")
but i am not getting the value out of the expression. Is the above expression true? If not what is used to get the value of the process data?
I believe your XPath expression is wrong. I just did a quick mock-up in workbench and I got the correct response. Here are the details of what I did:
Created an input string variable i workbench called addField.
Created a two step process. The first step has two routes going out to two different set values.
On one of the routes, I added the following condition:
/process_data/#addField = "true"
Turned on recording, and invoked the process.
In the input parameters screen in workbench, I added the following text: true
In the recording, I can see the expression evaluating correctly and going to the correct set value.
Do let me know if you have any other questions.
Thanks,
Armaghan.

Passing multivalue parameter to a subreport

I'm having a problem when working with multivalue parameters between reports.
I have a main report in which I have defined a multivalue paramer, which I use to run a SQL query to populate its dataset. The parameter is used in the WHERE clause in the following way:
WHERE values IN (#parameter)
It's working fine and it retreives the expected data.
Then this main report passes this parameter to a subreport. The parameter is also defined as multivalue in the subreport and, as far as I can see in the parameter's dropdownlist it receives the values in the right way. Something like this: A, B, C
The thing is that the query that populates the subreport's dataset returns nothing.
It also has a WHERE clause defined as in the main report (which is already working)
WHERE values IN (#parameter)
If I run the query manually, hardcoding the values to something like this:
WHERE values IN ('A', 'B', 'C')
it works, but when I try to use the parameter it doesn't. So, somehow it's losing the format or the values in the way.
I tried this solution in the subreport's dataset definition, which was proposed in another thread:
=join(Parameters!<your param name>.Value,",")
But it doesn't work for me, the dataset is still empty.
Any ideas about what I'm missing?
Thanks! :)
This should "just work." Make sure that the Parameter in the subreport is set up as multivalue, and I usually use the exact same query as in the parent report to provide "Available Values."
Check that you are passing the entire parameter to the subreport: In subreport properties on the parent report, the parameter's value should read [#MyParamName] not <<Expr>>. If it reads as the latter, edit the expression and make sure it doesn't have a (0) at the end. but =Parameters!MyParamName.Value is correct, not =Parameters!MyParamName.Value(0)
Just created the report from scratch again and it worked. I must have forgotten something in the middle.
Anyway, just in case somebody needs it, the two parameters, the one in the main report and the one in the subreport , must be defined as multivalue.
Then in your query you should use IN in your WHERE clase, something like this:
WHERE field IN (#parameter)
And nothing else is needed. I didn't need to do the following:
=join(Parameters!<your param name>.Value,",")
It just worked for me
I think I know what you did, as I was drawn here by having the same problem.
The subreports were setup fine, but when entering the parameter binding in the parent report, the Value drop down did not offer my parameter, so I used expression builder to select it. This left the grey << Expr >> marker in the value and would only work when I had only one value selected from the list. When I replaced this with [#MyParam] it worked fine regardless of the number of values selected. When I had a look at the value expression builder had created a bit closer it had =Parameters!MyParam.Value(0). Removing the (0) also fixes it.

Settings variable returning a different value in VB.net!

This is a quite strange problem. I have set a setting variable in Application settings with following data:
Name: county
Type: integer
Scope: user
Value: 0
Yet when I reference it with this statement: MsgBox(My.MySettings.Default.county)
It alerts 1. Despite being the first to be executed as soon as form loads.
I'm assuming that the My.MySettings bit is a typo.
Often when someone sees a different value than they expect when reading from My.Settings, it seems to be that they are reading the Default rather than the actual value.
I'd suggest trying to use just MsgBox(My.MySettings.county) and see if that returns what you want.
Otherwise, try to delete the bin and object directories of the project and try to re-compile and re-run and see if it might be something that had gotten "stuck" somewhere.