Search and Update the values of an Asset
In this guide we will showcase how to search for an existing asset within the asset database, store a value within a variable and then that value is used to update the assets' ip address.
Download template
Requirements
- Asset Integration
- Existing asset
Steps
- Add Trigger trigger object to the flow
- Edit the trigger, name it and define its schedule i.e. 60s
- Add Asset Search action object
- Edit the action, name it, and specify the search field for an asset:
{
"assetType": "computer",
"name": "example"
}
- Add a forEach object, name it, and define the Event Key (which would be the list to loop) %%data[action][assets]%%
- Add an action object, name it, set the variable ip as well as the value of the IP address we would want to change the asset to.
- Lastly, add an Asset Update action, specifying the existing asset name, type, entity, and source. Next, we use an in-built function %%now() on the Update Time field which specifies the time of update in epoch format. Once the Source Priority and Source Priority Max Age have been set, the asset fields that are to be updated needs to be specified as well (shown below). Finally, in order to not overwrite other fields, toggle the MergeSource option.
{
"ip": "%%var[local][ip]%%"
}
All above steps can be viewed below.