Skip to main content
Hi All,

I am trying to build a CAML query in one my k2 server events. But the string variable ignores all the spl chars.

refer to the below code. i just get the data in the data table and rest ignored.

pls advice.

.ToString();
sbQuery = sbQuery + @"</Value></Eq></Or>";
}
}
Hi Siva,

Hi haven't tested this yet but...

What is the value of: dsSecGrps.Tables[1].Rows[0].ToString()?

Also, what is the exact purpose of this line:
sbQuery + dsSecGrps.Tables[1].Rows[0].ToString();

Is it meant to concatenate the two values? Saving the result where?

What should your expected output look like?

Regards,
Ockert
Opps... its a typo. refer to the below.

.ToString(); 
sbQuery = sbQuery + @"</Value></Eq></Or>";
}
}
sbQuery = "<Query><Where>" + sbQuery;
sbQuery = sbQuery + "</Where></Query>"


dsSecGrps.Tables[1].Rows[0] contains values like Account1,Account2.

Output shd look something like



    <Query>
<Where>
<Or>
<Or>
<Eq>
<FieldRef Name="Type" />
<Value Type="Text">Account2</Value>
</Eq>
<Eq>
<FieldRef Name="Type" />
<Value Type="Text">Account1</Value>
</Eq>
</Or>
<Eq>
<FieldRef Name="Type" />
<Value Type="Text">Account3</Value>
</Eq>
</Or>
</Query>
</Where>

Thanks, and what does your current output look like (using the above code)?

Regards,
Ockert
Current output

Account2Account1Account3
We've tested the code as is - it gives the expected result.

Regards,
Ockert
Hi Ockert,

Thanks for ur time.

I have done a simple test. Trying to assign "<Eq>FieldText" to a string variable in K2 server event.
To my surprise, the output of the string variable is FieldText instead of <Eq> FieldText

Pls try this simple code,

.Value = CAMLQuery.ToString();

//Current output: FieldText
//Expected Output: <Eq>FieldText


But when I look at Temp variable value in process instance data thru k2 workspace, it shows value as FieldText. But expected output shd be <Eq>FieldText.

Highly appreciate ur help.

Thanks in advance,
Siva
I ran this exact code:
.Value + "'");    

}


and got the results shown in the attached K2Server Console.
As you can see - exactly as expected.

Regards,
Ockert
Hi Siva,
Were are you viewing your results?
It looks to me that it is ignoring the tags, exactly like it would do in a html viewer.
Perhaps your viewing it in a mail message sent in html format??
Regards
Gert
Gert , yes u r correct. I can't see the value thru workspace.

Ockert, thanks for help. Now i could see the values thru K2Server Console.

Siva

Reply