Yeshwanth
Novice

Expression to Check Text Data

Jump to solution

Hi ,

 

I have a list View and it has a column called Flag(Bit in Sql Server and YesNo datatype in smart object). So here I have to check something like this

 

If(Flag = 1) then "Open" else "CLOSE"

 

I tried using the expression but it is always displaying the False condition. Can anyone share their thoughts?

 

Thanks,

Yeshwanth

0 Kudos
Reply
8 Replies
AhmadAbdullah
Novice

Re: Expression to Check Text Data

Jump to solution

Dear , Just to understand the scenario clearly ,

 

could u provide a screen shot for the list and a screen shot for the expression u are tryin to do .

 

Regards.

0 Kudos
Reply
Yeshwanth
Novice

Re: Expression to Check Text Data

Jump to solution

Hi,

 

Here is the screenshot. I tried validating to Yes/1/true but it always gives me CLOSE.

 

3852i1C348E3E66345AE3.png

 

Thanks,

Yeshwanth

0 Kudos
Reply
Albarghouthy
Novice

Re: Expression to Check Text Data

Jump to solution

Hi,

 

Remove the Quotation marks "Yes" => Yes/True/1. If this doesn't work then put the control it self in the condition instead of the text property.

0 Kudos
Reply
Yeshwanth
Novice

Re: Expression to Check Text Data

Jump to solution

Hello Mustafa,

 

Thanks for your reply. Removal of quotation Mark didn't worked out. Also i couldn't able to drag the control. It says "To avoid circular references, this element is not available for use in this expression" 

 

Regards,

Yeshwanth

0 Kudos
Reply
AhmadAbdullah
Novice

Re: Expression to Check Text Data

Jump to solution

Dear ,

 

From what i see , ur tryin to change the text of data ,as VISUAL from yes/no to open/close ,

its true u get that error because u cant add an expression on a datalabel1 and use datalabel1 inside that expression for circulations.

2 approaches u might wanna use ,

the first one which would work for sure , is to create a stored procedure in ur SQL db , and use it to generate ur list view instead of using the SMO ,

in this way  u will be able to check the value and change its text  ,

 

second approach is to add a new column into ur list view , "Data label" type , and apply the expression u have into it , and show this new column and hide the original column , in this way u will be able to use the original CONTROL inside the expression , because u r applying the expression into another control .

 

Hope it helps!

regards.

Reply
Albarghouthy
Novice

Re: Expression to Check Text Data

Jump to solution

Hi,

 

Select the column and change the field property to None then in your expression use the field property in the condition. this should work for you.

Reply
Yeshwanth
Novice

Re: Expression to Check Text Data

Jump to solution

Hi AhmadYakub and Mustafa,

 

Thanks for your valuable sugessions. Your ideas worked like a charm. Only one thing is that I had to convert them to Text in the expression.

 

Thanks,

Yeshwanth

0 Kudos
Reply
Hind
Novice

Re: Expression to Check Text Data

Jump to solution

I actully collapsed the control and chose "Text". That worked perfectly for me.

Thanks for the inspiration though!

0 Kudos
Reply