Parameter popup

Hello,

In Perspective, I have a popup that needs to open, and I need to retrieve parameters sent when it opens. I don't know how to write the received payload.

The received payload contains lists.

Regards

I don't know how to write the received payload.

I'm assuming you mean how to write the transmitted payload. You would read the received payload, not write it.

An easy way to see the structure is to create the payload (temporarily) as a custom property, copy it and paste it into your code.

payload = {
  "bandName": "Perspective Swing Band",
  "genre": "jazz swing",
  "instruments": [
    "piano",
    "bass",
    "drums"
  ],
  "equipment": [
    "microphone",
    "amplifier",
    "speakers"
  ]
}

You can delete the custom property afterwards.

In the popup view, create PARAMS at the view level (above root).
When you create the PARAMS, the default will have an “inbound” arrow, meaning the PARAM will be populated from the call that opened the popup. By clicking the arrow, you can change the PARAM to outbound or both inbound and outbound.

The param names you create need to match the key values in the params dictionary that you include in the Popup Action or specify in the system.perspective.openPopup(id, view, params, title, position, showCloseIcon, draggable, resizable, modal, overlayDismiss, sessionId, pageId, viewportBound)statement.

Then you can create a bindings from the params to custom properties or props on the popup view.objects.
Event scripts in the popup view can reference the self.view.params.paramName

Here’s a link that should be helpful: Perspective - Embedded View | Ignition User Manual

Note that Markdown has inserted a space in Lynn's answer due to the switch between pre-formatted text and italics.
self.view.params. paramName
would be typed
self.view.params.paramName (but substituting the actual paramName).