Show or hide field depending on the content of another field/relation

We only want to display the custom field "latest_delivery_date" in the revenue line items if the product linked in the revenue line item is of the product type "Camera Systems".  In Studio, I can mark the field as dependent and then enter a formula. The syntax "is $product_type("Camera Systems")" does not work because there is probably no "is" function.




Where is the syntax incorrect?
How can I meet this requirement? Any suggestions or ideas are very welcome.

Thanks,
Steffen



  • Hey Steffen, 

    I'm not sure, but maybe the following will help.

    if product typ is a list use 

    isInList($product_type,createList("Camera Systems"))

    or


    If product typ is not a list use

    equal($product_typ,"Camera Systems")

    Kind Regards

    Ajay

  • Hi  ,

    For field visibility formulas, you need to use one of the formulas that returns a boolean (true/false) response. Those formulas are indicated by the icon with the empty and filled circles. The two best options based on your use case are equal() or isInList(). My personal preference is to always use isInList() since it allows for easier maintenance moving forward should your use case expand to other product types. To use equal, your formula would look like:

    Fullscreen
    1
    2
    3
    4
    equal(
    $product_type,
    "Camera Systems"
    )
    XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

    The isInList formula provides you a format where you can easily add additional qualifications at a later time. The formula would look like this to start:

    Fullscreen
    1
    2
    3
    4
    5
    6
    isInList(
    $product_type,
    createList(
    "Camera Systems"
    )
    )
    XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

    If you had another product type to add for the visibility dependency, you would add the value in the createList formula.

    Chris

  • Hi   - Many thanks for the quick and competent help. It works perfectly.  This community is so valuable.

    All the best,
    Steffen

  • Hi Ajay, Thank you so much for your prompt and competent help. Your proposal works perfectly. This community is so valuable!

    Cheers,
    Steffen