CPF Alerting modifications

I’m currently setting up a workflow that uses data to auto set thresholds for certain attributes on the devices alerting tab. Looking into the work flow that does this when the page is submitted it looks like its submitting every attributes and all of there possible configurations, even the ones that aren’t being modified.

Is there a simpler way of doing this that doesn’t involve sending every attribute like this. I havent really tried poking around at. I tried in the past with the API node and ended up removing alot of attributes from a device assuming that it would work similar to the device update node. It would be nice if the device update node allowed the adding/modifying of tags to attributes.

There is not a way to modify attribute tags on a single attribute. As you found, the PATCH and the Device: Update Node (when using payload path option) require the full details of the device object.

The most common workaround when receiving partial information is to query the full device object as part of the workflow, modify the specific fields, and then submit the full object with modifications applied.

Details for other readers: the workflow mentioned above is part of the Connected Product Foundation template and is named cpf-element-device-details-alerting.

1 Like

Actually, there is a way, though I’m not sure it’s easier than Brandon’s suggestion: The Devices: Patch API endpoint.

Though it’s a bulk-update endpoint, you could pass it a query that resolves to a single device ID and then pass a set of operations to perform against that device, such as setting the values of specific attribute tags.

The schema is kind of a mess so what I like to do is use the feature in the user interface, make an example request matching what I’m trying to accomplish through the API, and copy/modify the format of the request body to what I’m trying to do. Example attached for setting a single attribute tag on a given attribute name.

1 Like