Hello,
I am looking to see if it's possible to enrich data upon import into Assets from a .csv.
For example, if I have a .csv with a column "Name" and two attributes on an objects in Assets "Name" and "Location", if I want Assets to automatically input "Location" based on characters in "Name" upon import, is that possible, or is this something that would have to be done before importing?
If there's something that's not quite what I'm looking for but similar, I'd love to hear about that as well.
Thanks!
Welcome to the community.
Based on CSV import, you will have to specify this in the CSV column. The import can't fulfil this.
@Trudy Claspill makes a valid point to do this based on automation, but csv import in assets won't be seen as actions to trigger an automation. rule based on object creation.
You could do this based on a scheduled trigger and lookup objects where the attributes are empty. Branch over the results to fill the required information based on creating variables based on the name of the found object.
It's doable, but just providing this in the csv would be less effort in my opinion.
I was not aware that the CSV import process does not fire the Object Created event. Thanks for mentioning that!
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Thank you for letting me know!
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I had some time to test it, and it seems like importing from a .csv does trigger the object creation automation rules, which is really great!
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hello @Kyrah Johnson
Welcome to the Atlassian community.
Can you provide some examples of the characters found in the Name field and what you would set for the Location?
Are the characters always in the same position in the name; i.e. the first or last 3 characters of the name? Explain how you would manually identify the characters that are relevant in the context of the entire Name value.
What type of attribute is Location? Is it a selection list or a text field?
If it is a selection list, are the characters in the Name going to be a complete and exact match for one and only one entry in the Location attribute? Or does some evaluation process need to be applied? i.e.
If Name contains "AAA" then set Location to 111
Else If Name contains "BBB" then set Location to 222
Else set Location to 333
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
The name field always contains a location code within the first 7 characters, or starting in the middle after the 4th character.
An example would be DepMEXP123456. "DepM" in the beginning is always the same, the location code, in this case, "EXP" and the 6 digits at the end, in this case "123456", change per asset. The three letters in Name would only ever relate to a specific location, so just being able to use something like "contains EXP" for example would do the job.
The Location attribute is a reference to a Location object, entering the name of the Location object as text is enough to connect it after proper import mapping is done.
An evaluation process will need to be applied, something like "if name contains EXP, then set Location to Example." would be perfect. Is something like this possible in Assets?
I hope that makes sense!
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Thank you for that additional information.
How many Locations will there be?
My first thought is that this could be accomplished by Automation Rules that are triggered by Object Creation. Automation Rules definitely support that sort of logical structure. And it does have the capability to extract a specified number of characters from a specified location in a string. There are limitations on the number of components that you can have in a rule though, so if there are too many Locations then it might have to be broken into multiple rules.
The structure would be something like
TRIGGER: Object created
ACTION: Create variable
-- here is where the 3 characters would be extracted from the name of the created object
CONDITION: here we would use IF/ELSE to look at the value obtained, look up the Location object, and set the Location attribute
IF: Advanced compare
Smart value: {created variable name}
comparison: contains
value: EXP
-- ACTION: Lookup Object - look up the Example Location object
-- ACTION: Edit Object - Set the attribute to the found object
ELSE-IF
Smart value: {created variable name}
comparison: contains
value: BBB
-- ACTION: Lookup Object - look up the BBB Location object
-- ACTION: Edit Object - Set the attribute to the found object
ELSE-IF
ELSE
So that would not technically be "within" the import process. It would be adjacent to the import process.
I'm not sure if there is a way to embed that sort of logic in the import process itself. I know in Data Center at least there are ways to set an Object type of attribute during import. I'll have to go back to my notes to see how dynamic that was, and then figure out if the same could be done in Cloud.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Thank you for all of this information, it's pointed me in the right direction for sure!
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.