# Same label with different parameter in index page (different devices)

**URL:** <https://forum.genieacs.com/t/same-label-with-different-parameter-in-index-page-different-devices/704>\
**Category:** Uncategorized\
**Created:** [April 15, 2020, 3:00pm UTC](https://forum.genieacs.com/t/same-label-with-different-parameter-in-index-page-different-devices/704 "2020-04-15T15:00:44Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Gerard](https://avatars.discourse-cdn.com/v4/letter/g/ea666f/32.png) [@Gerard](https://forum.genieacs.com/u/Gerard)\
**Post date:** [April 15, 2020, 3:00pm UTC](https://forum.genieacs.com/t/same-label-with-different-parameter-in-index-page-different-devices/704/1 "2020-04-15T15:00:44Z")

</div>

Hi!  
Is there any way to add and if/else clause (or similar) to show differents parameters for the same label taking into consideration the DeviceId.ProductClass?

Example

```
- components:
    - type: "'parameter'"
  label: "'Serial Number'"
  parameter: DeviceID.SerialNumber
  type: "'device-link'"
- label: "'Model'"
  parameter: DeviceID.ProductClass
- label: "'Firmware'"
  parameter: InternetGatewayDevice.DeviceInfo.SoftwareVersion
- label: "'Info label'"
  parameter: if(DeviceId.ProductClass == potato) { InternetGatewayDevice.WANDevice.2.WANConnectionDevice.1.WANPPPConnection.1.Username}
else {InternetGatewayDevice.WANDevice.2.WANConnectionDevice.1.WANIPConnection.1.ExternalIPAddress}
- label: "'Uptime (h)'"
  parameter: InternetGatewayDevice.DeviceInfo.UpTime

```

Thanks!

---

<div class="post-metadata">

**Author:** ![Gerard](https://avatars.discourse-cdn.com/v4/letter/g/ea666f/32.png) [@Gerard](https://forum.genieacs.com/u/Gerard)\
**Post date:** [April 17, 2020, 9:48am UTC](https://forum.genieacs.com/t/same-label-with-different-parameter-in-index-page-different-devices/704/2 "2020-04-17T09:48:43Z")

</div>

I’ve been looking into the docs and I think the intended way to do this is using VirtualParamerts, right?  
Using the example above the code for this VirtualParameter is:

```
const now = Date.now();
let productClass = declare("DeviceID.ProductClass", {value: 1}).value[0];
let client = "";

switch(productClass) {
  case "model1":
    client = declare("InternetGatewayDevice.WANDevice.2.WANConnectionDevice.1.WANPPPConnection.1.Username", {value: now}).value[0];
    break;
  case "model2":
    client = declare("InternetGatewayDevice.WANDevice.2.WANConnectionDevice.1.WANPPPConnection.1.Username", {value: now}).value[0];
    break;
  case "model3":
    client = declare("InternetGatewayDevice.WANDevice.1.WANConnectionDevice.2.WANPPPConnection.1.Username", {value: now}).value[0];
    break;
  default:
    client = "not supported";
} 

return {writable: false, value: [client, "xsd:string"]};

```

model1 and model2 use the same parameter, model 3 uses another.

Any thoughts? Could this be done more efficiently?

Thanks!
