< Back

Get-AffinityFieldValue

Fri Jan 10, 2020 7:45 pm

NAME Get-AffinityFieldValue



SYNOPSIS

Read field-values for an organization_id, opportunity_id, or list_entry_id





SYNTAX

Get-AffinityFieldValue [-OrganizationID] <Int64> [-ListID] <Int64> [[-Expand]] [<CommonParameters>]



Get-AffinityFieldValue [-OrganizationID] <Int64> [<CommonParameters>]



Get-AffinityFieldValue [-OpportunityID] <Int64> [-ListID] <Int64> [[-Expand]] [<CommonParameters>]



Get-AffinityFieldValue [-OpportunityID] <Int64> [<CommonParameters>]



Get-AffinityFieldValue [-ListEntryID] <Int64> [-ListID] <Int64> [[-Expand]] [<CommonParameters>]



Get-AffinityFieldValue [-ListEntryID] <Int64> [<CommonParameters>]





DESCRIPTION

This function returns a PSObject containing all the field-values related to a given key.



Without the -Expand switch, the function returns the raw field values from Affinity, which is a bit cumbersome

to use without a detailed understanding of Affinity's data model. Leveraging the -Expand switch, the function

returns a rich PSObject that contains field name and other metadata in addition to the field values.





PARAMETERS

-OrganizationID <Int64>

The organization_id or entity.id from Affinity



Required? true

Position? 1

Default value 0

Accept pipeline input? false

Accept wildcard characters? false



-OpportunityID <Int64>

The opportunity_id from Affinity



Required? true

Position? 1

Default value 0

Accept pipeline input? false

Accept wildcard characters? false



-ListEntryID <Int64>

The list_entry_id from Affinity



Required? true

Position? 1

Default value 0

Accept pipeline input? false

Accept wildcard characters? false



-ListID <Int64>

The list_id from Affinity



Required? true

Position? 2

Default value 0

Accept pipeline input? false

Accept wildcard characters? false



-Expand [<SwitchParameter>]

Set switch to combine field names and other metadata in rich PSObject



Required? false

Position? 3

Default value False

Accept pipeline input? false

Accept wildcard characters? false



<CommonParameters>

This cmdlet supports the common parameters: Verbose, Debug,

ErrorAction, ErrorVariable, WarningAction, WarningVariable,

OutBuffer, PipelineVariable, and OutVariable. For more information, see

about_CommonParameters (https:/go.microsoft.com/fwlink/?LinkID=113216).



INPUTS



OUTPUTS

System.Management.Automation.PSObject





NOTES





Need to implement person_id. Need to test opportunity_id, list_entry_id.



-------------------------- EXAMPLE 1 --------------------------



PS C:\\>$ListEntries = Get-AffinityListEntry -ListName 'List'



foreach ($entry in $ListEntries) {

$EntryFieldValues = Get-AffinityFieldValue -OrganizationID $entry.entity.id -ListID $entry.list_id -Expand

Write-Output $EntryFieldValues.'Status'.field_value

}











RELATED LINKS

https://api-docs.affinity.co/#fields

https://api-docs.affinity.co/#field-values

https://api-docs.affinity.co/#the-field-value-resource

https://api-docs.affinity.co/#get-field-values