# Navigation by Dropdown

**URL:** <https://forum.inductiveautomation.com/t/navigation-by-dropdown/51272>\
**Category:** Ignition\
**Tags:** perspective\
**Created:** [September 23, 2021, 3:55pm UTC](https://forum.inductiveautomation.com/t/navigation-by-dropdown/51272 "2021-09-23T15:55:26Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![phandc](https://avatars.discourse-cdn.com/v4/letter/p/ce73a5/32.png) [@phandc](https://forum.inductiveautomation.com/u/phandc)\
**Post date:** [September 23, 2021, 3:55pm UTC](https://forum.inductiveautomation.com/t/navigation-by-dropdown/51272/1 "2021-09-23T15:55:26Z")

</div>

Hi, I’m new to Ignition. I’m am struggling to navigate to a specific screen when the user click chooses an option in Drop down. My dropdown has two options: siteA and siteB. I already assigned value 0 for siteA and value 1 for siteB. I have written a script and bound it on value of the dropdown. But it did not work.  
Here is my script that I wrote:

```auto
def transform(self, value, quality, timestamp):
	if value:
	   if value == 0:
	      system.perspective.navigate("/siteA")
	   elif value == 1:
	      system.perspective.navigate("/siteB")
	return value

```

Actually, I was not confident with this script. I felt it should return void instead of returning the value.  
I also tried to configure event for the click event, but it still did not work.

Thank you so much for your time.

---

<div class="post-metadata">

**Author:** ![paul-griffith](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/paul-griffith/32/37249_2.png) [@paul-griffith](https://forum.inductiveautomation.com/u/paul-griffith)\
**Post date:** [September 23, 2021, 4:23pm UTC](https://forum.inductiveautomation.com/t/navigation-by-dropdown/51272/2 "2021-09-23T16:23:25Z")

</div>

You probably don’t want to use a transform. Instead, add the sites you want to navigate to as the ‘value’ property of your dropdown options: [Perspective - Dropdown - Ignition User Manual 8.1 - Ignition Documentation](https://docs.inductiveautomation.com/display/DOC81/Perspective+-+Dropdown).  
Then right click the dropdown and ‘Configure Scripts’. Find the `onActionPerformed` event and add a Script action to it:  
[Perspective Event Types Reference - Ignition User Manual 8.0 - Ignition Documentation](https://docs.inductiveautomation.com/display/DOC80/Perspective+Event+Types+Reference#PerspectiveEventTypesReference-ActionPerformedEvent)

In that script, read the selected value and call navigate:

```auto
if self.props.value:
    system.perspective.navigate(self.props.value)

```

---

<div class="post-metadata">

**Author:** ![phandc](https://avatars.discourse-cdn.com/v4/letter/p/ce73a5/32.png) [@phandc](https://forum.inductiveautomation.com/u/phandc)\
**Post date:** [September 23, 2021, 4:51pm UTC](https://forum.inductiveautomation.com/t/navigation-by-dropdown/51272/3 "2021-09-23T16:51:21Z")

</div>

Yeah, it worked. Thank you for your help!

---

<div class="post-metadata">

**Author:** ![Cole\_Barthel](https://avatars.discourse-cdn.com/v4/letter/c/919ad9/32.png) [@Cole\_Barthel](https://forum.inductiveautomation.com/u/Cole_Barthel)\
**Post date:** [April 14, 2023, 8:23pm UTC](https://forum.inductiveautomation.com/t/navigation-by-dropdown/51272/4 "2023-04-14T20:23:35Z")

</div>

Worked for me as well
