Greetings,
I've built an online form with two important fields that dictate which regional office’s department will get the notification form. Here’s the deal – I’m using a macro expression to lists the DisplayNames of the regional offices’ to populate the 1st dropdown.
The second drop-down then uses that value to get the list of departments for that regional office. That is where I’m having trouble - using that value to get the list of DisplayNames for the second dropdown.
Here's how I imagine the two fields to work:
- Drop-down 1 lists the Regional offices – North; East; West; and South. The user selects region - West.
- Drop-down 2, which is disabled until drop-down 1 has a value, uses the selected value (West) in a macro expression to lists regional office’s department numbers (510, 511, etc.).
The end result: drop-down 2’s value is used in the notification recipient email field - {%DeptNum%}@company.com.
Here’s an example of the document tree:
Regional Offices (Parent to Regional offices')
- East (Parent to dept) > 510 (dept#), 511, 512, etc.
- West > 610, 611, 612, etc.
Here's the macro expression I’m using to get the DisplayNames for drop-down 1:
Documents["/Company/Regional-Offices"].Children.DisplayNames;#
For drop-down 2, I’ve tried using a conditional statement to return the value, for example:
regOff = Region.Value; if(regOff != “”){Documents["/Company/Regional-Offices"].Children.West.AllChildren.DisplayNames; }#
I even tried something on the lines of -
Documents["/Company/Regional-Offices"].Children.{% Region.Value%}.AllChildren.DisplayNames;
I thought about trying my luck with a foreach statement, but I’m a little confused by the macro expression example in the documentation. Any suggestions would be much appreciated.