If expression from boolean

If expression from boolean

  

Hi Guys, 

I would like to assemble a list of several products. The source is a entity with 

  • Product name (Text)
  • Service 1 (Boolean)
  • Service 2 (Boolean)
  • Service n (Boolean)

The list shall include all ProductServices =

  • Product name + if service 1 is true +if service 2 is true + if service n is true. 

Could you help me with a handsome way to code this?


Thanks! 

Tobias

Hi Tobias,

Do you want to concatenate the different columns and show the result in one column?

If so, while you iterate the List you can use use an expression and concatenate these values with IF statements. 

I am making an example for you.

Shashank..

Hi Shashank, 

indeed! ProductService is one name.

An example would be great!


Thanks

Hi Tobias,

So I created an Entity with the column you mentioned. In My preparation I used an aggregate on the table, on screen created and EXPRESSION with below statement

ListRecords1.List.Current.ProductData.ProductName + If(ListRecords1.List.Current.ProductData.Service1,ListRecords1.List.Current.ProductData.Service1,"")+ If(ListRecords1.List.Current.ProductData.Service2,ListRecords1.List.Current.ProductData.Service2,"")


See if this helps, if not let me know for more details.


Shashank...

Thank you! 

The solution works.

The output shows

Product --> Service --> True 

or

Product --> Service --> "Blank" 

iIs there a chance to hide the blanks and only show the "truth"?

Solution

Good that it worked out for you.

Yes, you can hide the "Blank" by just use "" in the else part. Here is my output

Updated condition

ListRecords1.List.Current.ProductData.ProductName + If(ListRecords1.List.Current.ProductData.Service1,"- " + ListRecords1.List.Current.ProductData.Service1,"")+ If(ListRecords1.List.Current.ProductData.Service2,"- " +ListRecords1.List.Current.ProductData.Service2,"")


Shashank...

Solution

Thank you so much for your help!!!

You are welcome...!