Get attribute value for multiple assets with Java API
I’m trying to build workflow to validate whether columns contain PII data or not.
Each column has “PII” attribute which is boolean data type (true or false).
My approach is get all value of “PII” attribute of columns and check the value of those attribute values.
However, I can not find the Java API to get attribute for multiple assets.
Any recommendations ?
huongtran_thu
Posted 2 years ago · Edited 1 year ago·Last reply 2 years ago
2 comments
huongtran_thu
OP2 years ago · EditedHi Jack,
Thank you. I will try on your recommendation.
jackfinegan
·2 years ago · EditedI think you should be able to just loop through a list of columns and check each for the value of PII. Here is an example of this logic:
def columns = relationApi.findRelations(FindRelationsRequest.builder().targetId(table.id).relationTypeId(tableToColumnRelationshipId).build()).getResults()
for (column in columns){def valuePII = attributeApi.findAttributes(FindAttributesRequest.builder().assetId(column.id).typeIds([PIIAttributeId]).build()).getResults()
if (valuePII == true){(whatever logic you want to apply)}}