setting a variable in a JavaScript while loop

Comments

1 comment

  • Kent Watson

    Doh!  Never mind I worked it out

     

    var url = "https://podio.com/<organisation>/crm/apps/contacts/items/"
    var mail = @All of Email.filter(function (obj) { return obj.type === 'work'}).map(function (obj) { return obj.value})
    var markdownTable = "|Name |Email |Work |Mobile|";
    markdownTable += "\n" + "|----------------|--------------|-------|----|";
    for (i=0; i<@All of ContactID.length; i++) {
    markdownTable += "\n |" + "[" + @All of Full name[i] + "]("+ url + @All of ContactID[i] + ")" + " | " +
    "[" + mail[i] + "](mailto:" + mail[i] + ")" + " | " +
    @All of Phone.filter(function (obj) { return obj.type === 'work'}).map(function (obj) { return obj.value})[i] + " |" +
    @All of Phone.filter(function (obj) { return obj.type === 'mobile'}).map(function (obj) { return obj.value})[i] + " |"
    };

    write = markdownTable

    0
    Comment actions Permalink

Please sign in to leave a comment.

Powered by Zendesk