Accessing Custom Variables via Powershell Script

Implemented

Accessing Custom Variables via Powershell Script

avatar

What's the method for accessing the list of custom variables as well as the value via powershell?

All Comments (7)

avatar

Hello,

Sadly there is no cmdlet available in the RDM PowerShell module to grab the custom variables and their values.

I have submitted a ticket to our engineering department. Once an update will be available, I will let you know.

Thank you for your patience.

Best regards,

Érica Poirier

avatar

@Erica:

Any news on that topic?
I'd like to create Customvariable automatically during a roleout for several hundred users.

avatar

Hello,

There is no new development on this request. I will ask our engineering team to raise the priority on this internal ticket.

In the meantime, you could try this to directly access any entry's custom variables and values properties or to set the information in the these properties.

$session.MetaInformation.CustomField1Title
$session.MetaInformation.CustomField1Value
$session.MetaInformation.CustomField2Title
$session.MetaInformation.CustomField2Value
...

And so on for all other custom fields of an entry.

forum image

Let me know if that workaround offers what you want to achieve.

Best regards,

Érica Poirier

avatar

I can't find the custom variable I defined via:
File - Options - Advanced - Application - Custom Variable
Name: totaluniquename
Value: totaluniquevalue

get-rdmsession | ConvertTo-Json -Depth 100 | out-file session.json

Open session.json with notepad and searched for "totaluniquename"

avatar

Hello,

Thank you for your feedback.

Those custom variables set in File - Options aren't available in PowerShell sadly.

Best regards,

Érica Poirier

avatar

Hello,

After investigation from our engineering team, as the custom variables set in File - Options - Advanced - Application - Custom Variable are located in the RDM configuration file, the PowerShell module can only read them. It is not possible to set any variable in that configuration file using PowerShell.

Another method to define global variables is to create them in Administration - System Settings - Custom Variables. These are available to all users connected to the advanced data source.

forum image

Let me know if that helps.

Best regards,

Érica Poirier

avatar

Hi,

Version 2023.1.0.9 has new commands (Get/New/Remove/Set-RDMDataSourceCustomVariable) to handle custom variables stored in the database.

Regards

Jonathan Lafontaine