Turn Email field into Text in a Calculation field

markdown12.6

This is a very useful feature, sometimes we need to write all the email addresses of a Email field into a Text field. Just copy paste the following code to a Calculation field:

var i;
var all_emails = “”;
var e = @Email;

for(i = 0; i < e.length ; i++){
    all_emails += “**” + 
                  e[i].type.charAt(0).toUpperCase() +  
                  e[i].type.slice(1) + 
                  “**: ” +

                  e[i].value + 
                  “\n\n”;
}
all_emails 

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

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 the @Email field with your app’s Email field. Thus, the following changes in “Modify Template”:

markdown12.1

gives us the following result:

markdown12.2

Do you want to take only the first email of an Email field?  Just copy paste the following code to a Calculation field:

 

@Email[0].value 

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

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 the @Email field with your app’s Email field. Thus, the following changes in “Modify Template”:

markdown12.3

 

give us the following result

markdown12.4

 

What happens in case you want to get the @All of Email? You need to write something different:

var r = “”;

r += @All of Email0].value;

r

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

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

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

This is because the type of @All of Email[0].value cannot be identified as a Text. Now we assign a Text field and append the @All of Email value.

 

Do you want to take all the email address of an Email field? They will be separated with commas, in this case. Just copy paste the following code to a Calculation field:

var i;

var all_emails = “”;
var p = @Email;

for(i = 0; i < p.length ; i++){
    all_emails += p[i].value + 
                  “, “;
}
all_emails = all_emails.substring(0, all_emails.length – 2);
all_emails 

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

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 the @Email field with your app’s Email field. Thus, the following changes in “Modify Template”

markdown12.5

give us the following result

markdown12.6

 

No comments yet.

Leave a Reply