I have Boolean variable
boolnamematches=true
booladdressmaches=true
boolnumbermatches=false
Comment to be added in excel as name, address matches telephone not matches
How to implement it in single line
I have Boolean variable
boolnamematches=true
booladdressmaches=true
boolnumbermatches=false
Comment to be added in excel as name, address matches telephone not matches
How to implement it in single line
Hi @sruthesanju
(If(boolnamematches, "name matches", "name not matches") & ", " & If(booladdressmaches, "address matches", "address not matches") & ", " & If(boolnumbermatches, "telephone matches", "telephone not matches"))
Which activity should I use this
Check with log message or message box.Whether you are getting the required output or not.
If yes store in the variable using assign activity and use in the further steps
Hope it helps!!
If(boolnamematches And booladdressmatches And Not boolnumbermatches, "comment in excel",Nothing)
name matches,add matches ,number not matches
How to make it like this
Name,add matches and number not matches
Check with this
(If(boolnamematches, "name matches", "name not matches") & ", " & If(booladdressmaches, "address matches", "address not matches")).Replace(", address matches", " and address matches") & " and " & If(boolnumbermatches, "telephone matches", "telephone not matches")
(If(boolnamematches, "name matches", "name not matches") & ", " & If(booladdressmaches, "add matches", "add not matches")) & " and " & If(boolnumbermatches, "number matches", "number not matches")
Replaces will not work it is not constant some time name will not matches same for add number either match or not match we will get
In the recent updated solution we havent used replace.Please check and let me know
This one is different right if matches cases means it should come as name ,add matches
from the above given requirement we derrive that the report is aggregating the matchnames on its results.
name, name1… matches name2, name3… not matches
We assume that it should be dynamically
One of more options is to model it as the following:
we create a dictionary (can by done dynamically)
then we process the dictionary entries by:
strReportLine =
(From kvp In dictMatchResults
Group kvp By k=kvp.Value Into grp=Group
Let nl = String.Join(", ", grp.Select(Function (g) g.Key))
Let rs = If(k, "matches", "not matches")
Select cs = nl & " " & rs).Aggregate(Function (x,y) x & " " & y)
Check:

It will by create dynamically build the string and also the position of trues, falses are irrelevant as it will catch it during the grouping