You can use the Oomnitza block to create, update, and retrieve data across objects in Oomnitza.
Scenario
Let’s say you want to send the asset name and the name of the user who created the asset record from the asset object to a custom object that you created called Asset Audit each time an asset record is added to Oomnitza.
Procedure
- Click Configuration > Workflows and add a new workflow.
- Edit the Begin block to run the workflow when new asset records are added.
- Add the Oomnitza block to the workflow and provide the following information:
- From the Module list, select Custom Objects Records.
- From the URL list, select
/api/v3/{custom_object_id}/create-or-update - For the HTTP method, select POST
- The path parameter is the ID of the custom object, which in this scenario is co_asset_audit.
Sending data to the target object
In the Oomnitza block body, click Select a field . Create the JSON body for the target object. You can update the target fields by referring to existing fields. When referring to existing fields, ensure that the field name is enclosed in curly brackets {{}}.
Fig 1: Updating the target object using the values stored in the Oomnitza Device Name field.
If the field has an Oomnitza object as its data type you will need to use dot notation to access the object's values.
The field that provides information about the user who added the record, the Created by field, has the Users object as its data type. For this field and other object fields, you use dot notation to target the information that you want to retrieve. Let’s say you want the email address of a user who is assigned an asset. To do this, you type created_by.username
Fig 2: Updating the target object using the values stored in the Oomnitza Created By field.
You can access all of the object's fields such as:
created_by.addresscreated_by.first_namecreated_by.last_namecreated_by.phone_numbercreated_by.rolecreated_by.user_idcreated_by.username
If the object information is stored in a variable, you must also use dot notation to access the value.
Did you know?
You can also use the dot notation to delve deeper into an object's metadata. For example, if you want to retrieve the email address of the user who created the assigned user, you type {{assigned_to.created_by.email}}
Comments
0 comments
Please sign in to leave a comment.