< Back

Remove-AffinityFieldValue

Fri Jan 10, 2020 7:49 pm

NAME Remove-AffinityFieldValue



SYNOPSIS

Delete a field-value





SYNTAX

Remove-AffinityFieldValue [-FieldValueID] <Int64> [<CommonParameters>]





DESCRIPTION

This function deletes a field-value based on a field_value_id.



There is one peculiarity to be aware of:

1) allows_multiple Attribute. If a given field has the allows_multiple attribute set, then

Remove-AffinityFieldValue needs to be called for each field_value_id to be deleted.





PARAMETERS

-FieldValueID <Int64>

The field_value_id from Affinity



Required? true

Position? 1

Default value 0

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





No enhancements planned.



-------------------------- 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

if ($EntryFieldValues.'Status'.field_value -like "Error") {

Remove-AffinityFieldValue -FieldValueID $EntryFieldValues.'Status'.field_value_id

}

}











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/#delete-a-field-value