Select property automatically depending on another property selected

When creating an aodocs document as final user, some properties are filled out automatically depending of which property you have selected at first. For example, if you have two properties in the document (City and Country). When you select Paris in the property "City", then France will be chosen automatically for "Country" property.  

6

Comments

11 comments
  • You can already achieve this by using Calculated properties.

    In your example, it will make the "Country" property read-only, the user will only have to select the "City" and the "Country" will be auto populated based on the city choice.  

    Another way to achieve this would be to create a multi-level Category, with the first level being the Country and the second layer being the city.

     

    2
    Comment actions Permalink
  • Thank you Thibault !

    Regarding the second solution, is it possible to force people to choose the level 2 ? as I remember it is not mandatory.

    0
    Comment actions Permalink
  • Can you give me an exemple for a calculated propertie please ?

    I have tried that :

    property`Business Entities`==='#{categoryValue:SNIkvzLvGouHHEiHtf/SNInzWF000000X6YS2}'==='katelyne.braunlich@xxx.com'

    but it doesn't work, in a JS file I would used IF ELSE but I need to know the "aodoc name" for the propertie I am working on but the system doesn't propose it.

    0
    Comment actions Permalink
  • Yes, you can select the option on your category property: Enforce selection of deepest possible category sublevel

    Regarding the calculated property, I believe it would look like something like this when set on the Country:

    property`City`.id === '#{categoryValue:SRq7NzU000001WI376/SRq7ROGxhiWZCHh1nV}'
    ? '#{categoryValue:SRq7L95ALhgcTmzc10/SRq7OCi00x8iJr7Vv5}'
    : property`City`.id === '#{categoryValue:SRq7NzU000001WI376/SRq7Sytufhm1AOzvCo}'
    ? '#{categoryValue:SRq7L95ALhgcTmzc10/SRq7P2C000000dC4V0}'
    : '#{categoryValue:SRq7L95ALhgcTmzc10/SRq86gu0000001jYo6}'

    In our calculated fields, we use the shorter version of the JS if else using:

    <boolean expression> ? <code if boolean is true> : <code if boolean is false>

    To know the "AODocs name" of the category value, you can use the section "From library" of the formula editor and select the category value you want to use, it will insert the "AODocs name"

    1
    Comment actions Permalink
  • thank you, I will try that !

    Actually I couldn't find the propertie because I had not saved it yet when I was trying to write the formula...

    0
    Comment actions Permalink
  • is it working with a property "person" ?

    0
    Comment actions Permalink
  • For the calculated properties, yes, you can make a person field calculated.

    1
    Comment actions Permalink
  • Great news !

    Do you have any example of JS code with the person field ?

    1
    Comment actions Permalink
  • I need to show/hide properties automatically depending of which property you have selected at first. I have 2 options (CP / Other ) when the user clic CP, hide the next properties, but when user clic OTHER option, show properties and make it mandatories.

    thank you!

    Sam

    0
    Comment actions Permalink
  • Hi Katelyne, 

    The details of a Person field value are mentioned in this article > "Format of the Person object"

    If you want to retrieve the email address of a Person field (named "Manager") which has been filled in, you can write: 

    propertyPerson`Manager`?.value
    If you need to set the value of a calculated Person property, you simply need to set the email address (string value), as illustrated here
     
    I hope this helps, 
     
    Adrien, for the AODocs Product Team 
    0
    Comment actions Permalink
  • Hi Samuel, 

    Thank you for sharing this use case! 

    I think the conditionally mandatory and hidden properties can address your need.  

    This article will explain how to make a property hidden and/or mandatory, based to the value of another field. 

    If the "CP/Other" property you're mentioning is of type Category, then this section ("Format of the Category object") will provide some help with the syntax.

    Additionally, in this article, the tip "Display property only if mandatory" explains how to make a property visible only when it is mandatory (and vice versa), which can be a nice time-saver, and avoid redundancy in the configuration.

    Feel free to reach out should you need any further assistance, 

    Adrien, for the AODocs Product Team   

    0
    Comment actions Permalink

Please sign in to leave a comment.

Didn't find what you were looking for?

New post