Show a Text field under conditions

markdown24.2

If you want to show a Text field under certain conditions, that is possible.

Let’s assume that you show the first and last name of an employee and the company that he works for in a field called: Employee info.

You also want to show whenever an employee is inactive, by including a warning message in the very beginning of the Employee info field. As a result, you create a field called: Is employee inactive?, so if “Yes” or “yes” values are given, then there would be a warning message in Employee info field.

Just copy paste the following Javascript code to a Calculation field.

var inactive = @Is employee inactive?;
var warning = “”;

switch(inactive){
   case “Yes”: case “Y”: case “yes”: case “y”: case “YES”:     
   case “inactive”: case “Inactive”: case “INACTIVE”: 
 
               warning = “INACTIVE! “;
}

warning + @First Name + ” ”  + 
          @Last Name  + “: ” + 
          @Company 

/* ——————————————————————————————————-

Created by BendixKiel ApS – Copenhagen based Podio Preferred Partner -with more than 6 years of experience in helping organizations implement Podio. Please feel free to contact us if you need help evaluate, structure or implement Podio in your organization.

BendixKiel ApS www.bendixkiel.org +45 71 99 05 80 anders@bendixkiel.org

———————————————————————————————————– */

Make sure you replace @First Name, @Last Name, @Company and @Is employee inactive? with your app’s employee’s first name, last name, company and employee inactive field

After applying the following code in Modify Template

markdown24.1

we get the following result

markdown24.2

 

As you can see, there is no “null” message in the Employee info field even though it is empty.

Let’s try to put values in the field: Is employee inactive?

markdown24.5 markdown24.4 markdown24.3

 

No comments yet.

Leave a Reply