Submitted by jimspoon on 2020/11/11 07:49
According to http://infoqubeim.com/drupal5/?q=node/128, auto-assignment rules can be triggered as follows:
 
  • A:  Update target field when the current field is added (initially no value in the current field)
  • M:  Update target field when the current field is modified (initially there is a value in the current field)
  • E:  Update target field when the current field is erased (the current field had a value and you deleted it)
Say you already have a value in the current field for an item, but now you want to create a new auto-assign value to push a value to a target field, or set a tag for that same item, without modifying the existing value in the current field for that item?  (As if the value were just added to the current field.)  Is there a way to do this?
 
I entered an auto-assignment rule to set a tag, to see if it would be applied where items already contained a value for that field.  Didn't work.  Also tried the Recalculate button, but that applies only to row equations.

Comments

Did you try Edit > Touch ?
 
It is supposed to do just that...
 
Pierre_Admin
IQ Designer
 

jimspoon

2020/11/12 15:26

In reply to by Pierre_Admin

Hi Pierre, thanks for your reply.  I hadn't tried Edit/Touch, so I gave it a try as follows.
 
I have a Y/N field named "USB Flash Drives".  As a test, for that field I entered the following auto-assignment rule in Manage Fields:
 
A:#USB_Flash_Drives|E:#USB_Flash_Drives=0
 
I had already created the tag USB_Flash_Drives in the tags pane.  
 
Then I highlighted all my items for which the USB Flash Drive field is checked, and then I did Edit/Touch.
 
I hoped that all these items would now be tagged with the #USB_Flash_Drives tag, but it didn't happen.
 
Am I doing something wrong?
 

Pierre_Admin

2020/11/12 16:16

In reply to by jimspoon

It works here...
 
Remember that Edit > Touch "touches" the selected cells, not the selected items. So you must select the appropriate grid column
Can you try that ?
 
Pierre_Admin
IQ Designer
 

jimspoon

2020/11/12 22:14

In reply to by Pierre_Admin

In the example above, I added the column "USB Flash Drives" to my grid, and all the TLIs appeared checked.  Then I highlighted all the TLI cells in that column, did Edit > Touch, but none of the items were tagged with the #USB_Flash_Drives tag.  I also tried right-clicking the column header and clicking Select Column before I did Edit > Touch - same result, no tagging.  I tried refreshing the tags list to see if the tagging would appear, no luck.  
 
I added the AA rule A:[Test] to see if that work, didn't work whether I Touched the whole USB Flash Drives column or just a single cell.
 
The AA rule does work if I check/uncheck the USB Flash Drives field manually - the corresponding tag does get checked/unchecked.  It's just the Edit/Touch method that's not working.
 
 

Pierre_Admin

2020/11/13 00:00

In reply to by jimspoon

The Touch command does the equivalent of a Modify event auto-assign, so replace A: with AM: and it should work just fine
[quote]
Auto-assign rules can also set tags: use #TagName=-1 or #TagName=0 to set / unset tags
[/quote]
 
Pierre_Admin
IQ Designer
 

jimspoon

2020/11/13 01:08

In reply to by Pierre_Admin

Thanks Pierre, I got it working.  "AM:#USB_Flash_Drives" didn't work, but "AM:#USB_Flash_Drives=-1" did.
 
I was following this from http://infoqubeim.com/drupal5/?q=node/4328 section 6:
 
 So using a simple auto-assign rule, it is possible to update 1 or more tags whenever a field is changed, hence linking fields and tags. 
To do so, in the field auto-assign section enter:
  • A:#TagName | E:#TagName=0
 
I gathered from this the "-1" might be assumed, but maybe not?
 

Pierre_Admin

2020/11/13 15:57

In reply to by jimspoon

Indeed...
Improved in v116i:
  • New: Fields: In auto-assign equations, simpler syntax to set/unset tags. Details here
 
Pierre_Admin
IQ Designer