I have used the API in the past for deleting large numbers of assets but never for something like this. Thank you for taking the time to share such detailed instructions. I did get an error on the first couple of attempts but then I spotted that something may be missing from the excel formula and when I amended that, it all worked perfectly. I've noted this below in case someone is using this thread in the future for help.
Original Message:
Sent: 01-15-2025 10:35
From: John Taylor
Subject: Mass change/edit asset name
Hi Peter,
Key fields can be difficult things to update, even with Govern giving us the ability to switch which fields are considered a "key" (primary key) field as if you don't use your created key, what do you use...?
Well the answer is actually really easy, we use the internal govern key for our records.... known as UID's in Govern and found the "System Fields" section on each asset, these UIDs allow use to modify every custom field we have created using the UID as the key - however we do have a limitation that the bulk loader doesn't like to play with UIDs and to work around that - we need to use the APIs...
If you haven't worked With the govern API before it can sound a daunting task and a little overkill to build API leave solution for this type of data updating, but the govern has a nice built in Swagger interface that allows us to play with the APIs in a really agile way, without the need to actually build anything..
We can copy and paste data from excel into Swagger and simply use the swagger interface to make those changes
To do that we must follow a couple of steps.
1] Download all your ~100 records in a Excel file
2) visit the swagger page via the Admin - API menu in Govern. Go to "ASSETS" as we are going to be updating assets and then find the Assets by Asset Type end point. | PUT /api/v2/assets/{assetTypeUid} - The Type UID you will find in the System fields in Govern. The Type UID will be the same for all assets in the same object in Govern.
3) Paste the Type UID in the type UID field at the top of the section
4) Then we just need to get the rows we exported into Excel into the correct format to load. By default the format looks like this: [
[
{
"Uid": "00000000-0000-0000-0000-000000000000",
"ExecutionItemUid": "00000000-0000-0000-0000-000000000000",
"ParentUid": "00000000-0000-0000-0000-000000000000",
"SourceID": "optionalCustomIdentifier",
"Fields": {
"MyApiFieldName1": "My Field value",
"MyApiFieldName2": "My Field value"
}
}
]
But we really want to get that onto a single line in Excel and we can get rid of the "[" and "]" from the start and end for now - we can add them back in at the end. We can also remove the ExecutionItemUid, ParentUid & SourceID - we don't need them.
That leave us with some like this:
{"Uid": "00000000-0000-0000-0000-000000000000","Fields": {"MyApiFieldName1": "My Field value"}},
Where the UID is the UID of the record you downloaded in the Excel (unique per records - not the Type UID we used earlier) and the MyAPIFieldName1 and the API name of your field that you want to update - I think you have called your field "Name"
Please note the "," (comma) at the end of the row to separate each line, you need to separate each row for the JSON to work
5) Swap the double quote for single quote in Excel and it makes writing the formulas easier:
="{'Uid': '" & CELL WITH UID IN & "','Fields': {'Name': '" CELL WITHNEW NAME IN &"'}},"
6) Copy that formula down across all rows.
7) Copy and paste the entire selection of rows into Swagger payload with the "[" and "]" added back in
8) Press test it out and it will load and update your fields - maybe try and 2 or 3 records 1st time.
Good luck and let me know if you have any questions.
------------------------------
John Taylor
Metadata Manager
EXPERIAN LIMITED
Original Message:
Sent: 01-14-2025 11:05
From: Peter Carroll
Subject: Mass change/edit asset name
Is it possible to mass change/edit the names of assets? For example, I have ~100 entries in my data dictionary and the name (key field) of these assets needs to be amended. Will this have to be done manually one by one or can they be edited with a mass change?
If I was to bulk load these assets with the amended names it will just create new entries and I don't want to take this approach because the existing assets have many relationships created that would be lost.
------------------------------
Peter Carroll
Enterprise Data Governance
Perrigo Company plc
Dublin, Ireland
------------------------------