Retrieving Custom Fields From Connection Profiles

Good morning everyone, I am posting to see if anyone has worked with the custom fields in the connection profiles. I have created a custom field as shown below, but I can’t seem to find any reference to it within the activity configuration returned in a custom PowerShell action.

When pulling the activitySession I see there is a property for ActivityConfiguration that contains a sub property named customFields; however, customFields is never populated with any data. Am I missing something obvious perhaps or is something not working as intended?

I have also attempted to call the variable name $snapshotOptions directly from within the custom PowerShell action step thinking that it may have auto populated the variable for me, but that also does not seem to be the case.

If anyone else has worked with the custom fields for connection profiles I would love to get some insight. If this is better suited to be handled by support, please let me know and I can open a ticket with them instead.




—EDIT—
Testing a little further and after re-creating the connection profile I am able to see and reference the customFields correctly now. I would delete this topic but it may be helpful to others. If you are looking to reference your custom connection profile fields they are stored as a property customFields within the activity session itself, not the underlying activity configuration. See the code snippet below for retrieving them from a custom PowerShell action.

$activitySession = Get-SbPAMActivitySession -Id $SessionId
$customFields = $activitySession.customFields | ConvertFrom-Json -ErrorAction SilentlyContinue

Add-SbPAMActionLog -Type Info -Message "OPTIONS: $customFields"
2 Likes

Hey David,

Thank for pulling this together, with the solution as well!

I’ll make sure we get this added to the documentation as soon as we can.

Appreciate everything you are posting here; this perfectly shows the benefit of the community. I am exploring some direct community integrations that will be exciting if we can pull it off. More to follow on that!

All the best,
Martin

1 Like

Great stuff as always, David!