Submitted by jimspoon on 2023/10/05 02:26

Say I have a yes/no field "Banana" and if it is checked, I want to assign the text "Banana" to the field "Fruit Type".  I thought an Auto Assign rule for the Banana field "A:Fruit Type="Banana"" might do it.  But it seems that the rule will not trigger for items where the "Banana" field is already checked when the rule is created.  I can double-click on the Banana field to bring up the items in a scratch grid, and I added the Banana field as a column.  Then I highlighted all the items in the column, pressed space to clear the checkmark, then space again to re-check the items.  This works to assign the text "Banana" in the "Fruit Type" column.  Is there an easier way to get the rule to fire without having to do these extra steps?

Comments

Hi jimspoon,

I think you might achieve what you want by using a row-equation instead of an auto-assign rule as you can set these to auto-update.

See here (in the manual).

This is the info on automatic recalculation:

Recalculating

Instead of waiting for a field argument to change, you can force a Row Equation to recalculate. You can do this by selecting the field and pressing Shift-F9. This will cause the Row Equation for that field to immediately execute.

You can also recalculate a field for all items by clicking the recalculate button next to the Row Equation’s text field in the Field Management Dialog.

You also have the option to have a field’s Row Equation recalculate for all items daily. If you check the Auto-update checkbox  above the Row Equation’s text field, then InfoQube will recalculate the field for all items on each change of day (at midnight or the next time you start InfoQube). Note, Auto-updating can be a lengthy process, so use it only when required.
NOTE, when recalculating Row Equations will only fire if they have a field argument that has a value. If none of the field arguments have a value then the Row Equation will not fire. That means Row Equations with no field arguments will never fire (e.g. =Now()).

HTH

Left

I think you might achieve what you want by using a row-equation instead of an auto-assign rule as you can set these to auto-update.

Auto-update should only be used when the equation contains a "Now" variable. In these cases, the value needs to be recomputed when the day changes. Otherwise, equations are recomputed whenever a field value (used in the equation) changes

Thank you Left, I tried that out.

I made a text field named TestEquation, and in the Row Equation box I put the following:

=iif([Display Adapters],"Display Adapter",[TestEquation])

When I clicked the Recalculate button, for every item for which the Y/N field "Display Adapters" was checked, the TestEquation was filled with the text "Display Adapter".  If the "Display Adapters" field was not checked, the text if any in theTestEquation field was not changed.

IIF is not a native VBScript function but a User Defined IIF function is included in the System Code section of the VB Editor tab.  It didn't work until I added the third argument.

it works!  but I'd have to change the Row Equation to have it generate values for "TestEquation" other than "Display Adapter".  Because of this it might be better if I could set an Auto-Assign for the [Display Adapters] field and any other Y/N fields I might want to push some text into the "TestEquation" field, and do a Recalculate to trigger that Auto-Assign for items that already have those Y/N fields set.

I bet I can figure out how to change the IIF function to output the name of the Y/N field as a text value to the text field containing the row equation.  Maybe there is a FieldName function somewhere.

 

 

Hi,

Auto-assign rules are much more flexible than row equations, especially for complex cases (i.e. multiple checkboxes)

Provided your rule has AM: (not just A:), a quick way is to select the checkbox cells (or the whole column) and do Edit > Touch. It basically executes the M: rule

 

Could not find anything in the documentation when I began wondering

Did you live-search "Touch" in the Welcome to IQ IQBase? It is explained under the Edit Menu 

How do I ?