Skip to main content

Search

Field value sets value of another field

Answered

Comments

3 comments

  • Andrew Sayers

    I found out how to create the expression. Here I will share it with you.

     

    I have a choice field called "Conference Rooms" with a drop down value Room 1 / Room 2 etc. Each room has a certain capacity. So when a user selects the room i want another feild called "Capacity" to display the capcity number.

    Here is the expression i used for the "Capacity" field. This was using "Function Code" in the expression builder.

     

    if ([[ConferenceRooms]] =="Room 1")
       return "22";
    if ([[ConferenceRooms]] =="Room 2")
       return "24";
    if ([[ConferenceRooms]] =="Room 3")
       return "14";
    if ([[ConferenceRooms]] =="Room 4")
       return "14";
    if ([[ConferenceRooms]] =="Room 5")
       return "14";
    if ([[ConferenceRooms]] =="Room 6")
       return "14";
        else return null;

     

    Have a great Friday and Weekend !

    0
  • Matthias Walter

    Hi Andrew Sayers,

    there is an easy an dynamic way if you have your rooms in a separate list with a lookup to this list from your form.

    Let's say the lookup list looks like this:

    Add a lookup to this list and add a calculated expression on the capacity field in your form:

    Using a lookup you can access all the fields from the target list in the expression builder in the right panel.

    You can optionally set the field to "display only":

     

    Kind regards

    Matthias

    0
  • Andrew Sayers

    Hi Matthias Walter

     

    Many thanks for the help.

     

    Best regards

     

    Andrew

    0

Please sign in to leave a comment.