- Community Home
- >
- Software
- >
- HPE Morpheus Software
- >
- HPE Morpheus Enterprise
- >
- I have some troubles in Options lists in terms of ...
Categories
Company
Local Language
Forums
Discussions
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Forums
Discussions
Discussions
Discussions
Forums
Discussions
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
- BladeSystem Infrastructure and Application Solutions
- Appliance Servers
- Alpha Servers
- BackOffice Products
- Internet Products
- HPE 9000 and HPE e3000 Servers
- Networking
- Netservers
- Secure OS Software for Linux
- Server Management (Insight Manager 7)
- Windows Server 2003
- Operating System - Tru64 Unix
- ProLiant Deployment and Provisioning
- Linux-Based Community / Regional
- Microsoft System Center Integration
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Community
Resources
Forums
Blogs
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-06-2022 07:49 AM
10-06-2022 07:49 AM
I have created a two option lists in Morpheus.
Availability Zone:(fieldname:az)
us-east-1b, us-east-1c, us-east-1d
Operating System: (fieldname:os)
RHEL8
AL2
Windows
I am trying to make a relational dropdown between availability zone and OS here.
When user chooses US-east-1b then I will have to display RHEL8, AL2.
If User chooses us-east-1c, then I will have to display just Windows.
What is the condition I need to pass in visibility field of Operating system which can help me with value based drop down ?
Will be helpful if you can help me with syntax.
Solved! Go to Solution.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-07-2022 06:07 AM
10-07-2022 06:07 AM
Re: I have some troubles in Options lists in terms of visibility field
Hi Venkat,
You can do this in 2 ways.
First way - If your OS data can be hosted on a JSON source, you can use the REST option list and translation script. You would need to configure you JSON data as follows:
[{
“id”: 1,
“os”: “RHEL8”,
“az”: “us-east-1b”
}, {
“id”: 2,
“os”: “AL2”,
“az”: “us-east-1b”
}, {
“id”: 3,
“os”: “Windows”,
“az”: “us-east-1c”
}]
You could then use the following translation script on the operating system list:
for(var y=0;y < data.length; y++) {
if (input.az == data[y].az) {
results.push({name: data[y].os,value:data[y].os});
}}
Second way - This is more complex and requires more java scripting knowledge. This approach uses the manual option list and a mapper variable.
Create a manual option list for operating system.
In the dataset field, enter [ ] to create an empty list.
Then in the translation script, you would have to create a java script similar to this which generates the option list using the results.push method:
let mapperKey = input.az;
let mapper = {
“us-east-1b”: [
{“name”:“RHEL8”,“value”:“R8”},
{“name”:“AL2”,“value”:“A2”}
],
“us-east-1c”: [
{“name”:“Windows”,“value”:“WIN”}
],
“us-east-1d”: [
{“name”:“RHEL8”,“value”:“R8”},
{“name”:“AL2”,“value”:“A2”},
{“name”:“Windows”,“value”:“WIN”}
]
};
if (mapperKey in mapper) {
let localOptions = mapper[mapperKey];
for (let i = 0; i < localOptions.length; i++) {
results.push({“name”: localOptions[i].name, “value”: localOptions[i].value });
}
}
NOTE: In the above example, the availability input has the fieldname set to az. You also need to make the operating system input dependent on the availability zone input.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-18-2022 07:43 AM
10-18-2022 07:43 AM
Re: I have some troubles in Options lists in terms of visibility field
@pjones I have tried the the syntax like mentioned above, however, I am not seeing any options being listed in my catalog for OS list. Wanted to review the Syntax If I have missed anything specific:
Data set:
[{“os”:“RHEL8”,“az”:“us-east-1b”},{“os”:“AL2”,“az”:“us-east-1b”},{“os”:“Windows”,“az”:“us-east-1c”}]
Translation Script:
console.log(input.az)
for(var y=0;y < data.length; y++) {
if (input.az == data[y].az) {
results.push({“name”: data[y].os,“value”: data[y].os});
}}
Catalog Page:
Drop down results as no Option found:
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-24-2022 03:30 AM
10-24-2022 03:30 AM
Re: I have some troubles in Options lists in terms of visibility field
Thanks @pjones for the wonderful explanation. It is working as expected!

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-23-2022 02:53 AM
10-23-2022 02:53 AM
SolutionHi Venkat,
You will need to make sure that you set the dependent field setting on the input for the operating systems.
I’ve set this up in my lab and made a recording to show you it working - Screen Capture on 2022-10-23 at 10-47-45.mp4 - Droplr
Thanks
Pete