Metadata Fields Management Rule Interface

This seems like it should be simple, but have read the section in the Workflow user guide and still do not understand how to construct a condition in the rule interface.

I would like to add a “1” to a field in the metadata if a another field equals “99900”

Reading about the task it seems it should be possible but I do not know how to do it.

What do I put in the “Click to set expression” I have tried putting the field name then Equal the adding “99900” in the second expression.

Sorry but I just cant figure it out.

Hi Chris,

Assuming you have both the metadata field populated and the comparison field populated prior to the operation, you can use the fields management plugin to append a value after its original value based on the rule you mentioned. You would choose the “append” action, the field information column should contain the metadata level and metadata field name for which you want to append the “1”, and the value field should be only the character “1” without quotes. Then in the rule column, in the “click to set expression” field, you will right-click and choose the data source for the 99900. It can be another metadata field, a workflow variable, a data selection, etc. Then the operand will be “equal” and the right portion of your expression will be 99900, or another variable that captures a runtime value (in case 99900 was just an example and you actually want to add the 1 if field A equals field B)

That should theoretically produce the result you described.
Hope that helps.

Regards,

Thank you for the help with this. much appreciated, sorry for the long time before my reply.

This now works as intended, but I have a problem with the time it takes to run. The workflows I use this in now take a long time to run. when I have 7,700 records, according to the service console it takes 23 minutes to run the action script out of a total time to run the whole workflow of 33 minutes.

Is this to be expected with this kind if Action Script?

What does your script do?

The action script reads a field that has been populated by our mailsort plugin. If the field reads 99900 then another field is updated with a 1. This can then be used in the control barcode we add for use by our mailing machine.

image

image

If your script adds a field to the metadata, then that operation is very time consuming. But if it updates the value of an existing metadata field, then it should run extremely fast.

So to eliminate the performance issue, you should simply make sure that the field is created at the same time as all the other fields (even if you don’t store any value in it). Then your script can just update the value, which will be much faster.

Thanks Phil I will change it.

Hi, the Metadata Fields Management does not have an update feature. How would I go about changing the process to update the field?

As the online documentation states, fields.Add() adds a new element to the collection or overwrites its value.