retreive most recent value in relationship calculation

Comments

4 comments

  • Adrien BLAISE

    With @All of Linked item field[0].

    0
    Comment actions Permalink
  • Mike Adams

    Hi Adrian, thanks for your response

    @All of Linked item field[0] seems to retrieve the oldest version of the related item rather than the most recent

    0
    Comment actions Permalink
  • Mike Adams

    I found the way to do this by browsing the other questions and answers - many thanks to Rainer.

    I want to retrieve the most recent value of a related set of items.

    The calculation command @All of Linked Item Field[0] returns the first or oldest related data item

    and the .length function returns the number (count) of data items. In my case @All of linked itemfield.length returns 4 - there are four data items - but they are numbered 0,1,2,3 so I need to retreive item 3.

    The javascript code that does this looks like this

    var a = @all of FieldNameInAppB
    a[a.length-1]

    0
    Comment actions Permalink
  • Adrien BLAISE

    Strange, as I thought that the @All of... arrays were sorted from newest to oldest, so indice 0 would return the most recent. I think I've been using it like this successfully. Great that you found a way anyway.

    0
    Comment actions Permalink

Please sign in to leave a comment.

Powered by Zendesk