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