Showing result in calculation field based on category field result



  • Rainer Grabowski

    Hi Susan,

    is "Qualifications required" a field in the same app where you have the calculation field? If so it's strange that it doesn't show up. Did you save the app template (without calculation field) before you tried to build your calculation? If you want to pull data from a field in another related app you have to pull it with @all of field name.
    Also your IF syntax is wrong: 

    var result = "";
    if(@Qualifications required == "Yes") {
    result = @All of quals.join();
    } else {
    result = "N/A"

    If it still doesn't work attach screenshots, please.

    Comment actions Permalink
  • Rainer Grabowski

    Regarding your other question: 
    Do you use 

    moment(@All of Date Teacher Status checked with nulls.join()).format("D MMM YYYY")
    in a for() loop with multiple related items or do you pull always one related item (= one date) only?
    If one item only:
    var date = @Max of Date Teacher Status Checked;
    date != "" ? moment(date).format("D MMM YYYY") : ""
    If in a loop I need to see the whole calculation (screenshot).
    Comment actions Permalink
  • Susan Warren-Moy

    Hi Rainer

    Thank you - I knew I was wrong somewhere in my IF statement but couldn't figure it out! I think part of it is that i was expecting to see something other than the "A" denoting a text field, for the category field in the calculation, which threw me.

    Also I realised after I'd sent this post that I've already figured out how to do the "N/A" for the date as I'd done it elsewhere on the same template - just hadn't read that far down the page! Thank you for the fix though, it's the same as I'd already done. :D I am learning!

    I did figure out a workaround for it but it wasn't as simple or elegant as the code you gave / I already had!

    All sorted - I will try and remember that category fields show as text type for the purposes of a calculation (of course they do!).

    Comment actions Permalink

Please sign in to leave a comment.

Powered by Zendesk