Creating Calculation Field with API - variable is not valid

Comments

5 comments

  • Andreas Garnæs

    The format of variables in calculation fields is [label](variable-identifier). The label is only for showing in the UI. There are a number of variable identifiers, the simplest of which is field_X, where X is a field id. So instead of @Test you need do use @[Test](field_123), where 123 is your field id.

    Hope it helps.

    Best,
    Andreas

    0
    Comment actions Permalink
  • Scott Costello

    Thanks Andreas. That leads me to another question...If I'm creating the fields within the PodioApp::Create() call, how will I get the Field ID of the field I need to reference in a calculation if I'm creating all the fields in one Api call? Am I making sense?

    Also, is there a reference page to where I can find all the variable identifiers?

    0
    Comment actions Permalink
  • Andreas Garnæs

    You won't be able to create both in one go -- the calculation field will have to be added in a second call.

    Variable identifiers are currently not very well documented, but if you have specific requirements, I can try to help.

    0
    Comment actions Permalink
  • Scott Costello

    I got the calculation field working perfectly now thankyou!

    Not sure if I should submit a separate question, but it's kinda related so here goes...

    I'm now creating a reference field in my Property App. In the Property App I'm creating a Reference field to reference a Contacts App. I'm building the API call and I have a question for what the App_Id value should look like?

    $flds = array(
    type => "app",
    config => array(
    label => "Contacts",
    description => "Add new contacts here",
    delta => 3,
    settings => array(reference_apps => array(app_id=>$contactAppId)),
    multiple => true));

    $contacts_id = PodioAppField::create($appId,$flds);

    This Api call creates the Reference field no problem, it just doesn't reference the Contacts App. I didn't include the view_id because I really didn't know what that was or how to get it.

    0
    Comment actions Permalink
  • Scott Costello

    I figured it out. I just need the straight up ID value i.e. 5151121. I also have to do a better job on spelling because I've spent hours debugging code where I spelled it like "reference_apps" instead of "referenced_apps" (with the "d"). ugh! Thanks for the help Andreas. I'm sure I'll have more questions as I work through the API

    0
    Comment actions Permalink

Please sign in to leave a comment.

Powered by Zendesk