Auto Update atribute field with another asset

is there a way to create a virtual field , so if i have a township attribute i want to automatically be filled on creation of a defect or asset. could this be done through the AQS attribute ?

Hi @phillgeorgiou,

There are a number of ways to achieve this.

If you want the defect or asset that is being created to have a copy of the value from the township then you could use a workflow that makes use of the Create trigger to copy the value from a connected item. More info on workflows here: Workflows | Alloy Help

Alternatively if you don’t need to query on the data and simply want to display information alongside the Defect or Asset without adding more attributes you can do this with the AQS Query control on the stencil. More info on the Stencil Editor here: Stencil Editor | Alloy Help

Both approaches have their pros and cons but the important thing to decide is will you need to query on this information later. Hope that helps :wave:t3:

hi Nicholas

have tried this with a workflow and have done 2 separate branches to listen on creation of the defect if the geometry from the defect is within a certain township to then edit the township attribute which is a link attribute to populate it constantly.

however , when i add another branch this does not work , it only works with single branches. i have tried changing the filters to query’s to see if this helps but again still takes the first branch.

Hi @phillgeorgiou,

This should be achievable through workflows, though I think with the method you’re describing here, you’ll end up with a workflow branch per township. Basically, each branch should have a filter that checks if the defect created is within the defined bounds of the township, then edit the township link on the defect. The workflow should only go down one branch if all the townships are distinct and do not intersect. The branches should definitely use Filter nodes, not Queries.

It might help if you could post some screenshots of your workflow and we can see what it’s currently doing?

The other option is to go down a Workflow Computation route, which will require some editing of your Workflow through the API. Check out Example 9 on this help article: Computation examples | Alloy Developer Guide

Hi Jonathan

thanks, have done this through the workflow.

1 Like