Show your referenced item fields in a table

showitems1.2

Example of table

Let’s say you have used a Relationship field in your app for referencing another app, and you want to show a nice table with specific fields of each referenced item.

Then you should copy paste the following javascript to a Calculation field:

var fn = @All of First Name;
var ln = @All of Last Name;
var oc = @All of Occupation;
var bd = @All of BirthDate;

var i;
var h, m, s, r, dur;
var res = “First Name|Last Name|Occupation|BirthDate|\n:— | :— | :— | :—\n”;

if(fn.length == 0){
res = “No referenced items”;

} else {

for(i = 0; i < fn.length ; i++){

/* Create table element */
res += fn[i] + “|” +
ln[i] + “|” +
oc[i] + “|” +
moment(bd[i]).format(“DD/MM/YYYY”) + “|\n”
}
}
res

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

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

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

Don’t forget to replace the “@All of” variables that are in the very beginning of this javascript with your own referenced item fields.Then you can show four fields in the table.

You also need to replace the line:

var res = “First Name|Last Name|Occupation|BirthDate|\n:— | :— | :— | :—\n”;

with your own field titles!

So instead of “First Name”, “Last Name”, etc you will put your own field titles. It is easy to find out if you experiment a little bit.

Let’s try to put it in Modify Template:

Modify template in Podio

So the result is the following:

showitems1.2

2 Responses to Show your referenced item fields in a table

  1. Rudy July 22, 2016 at 2:53 am #

    I need to make a calculation field, with one specific reference from a relationship field, but when i type @ in the calculation field the reference or relationship does not show, can you anyone help me solving this, neither if i type @all of the relationship does not show

  2. Anders Bendix Kiel July 29, 2016 at 9:36 pm #

    Hi Rudy,
    I think that you might have tried to type the apps name and not the name of the field. Could that be the case?

    Best regards
    Anders Bendix Kiel

Leave a Reply