cancel
Showing results for 
Search instead for 
Did you mean: 

How to I store & retrieve a Keyword on a Virtual E-Form inside Workflow?

Julie_Brown
Star Contributor
Star Contributor

I created a Virtual E-Form that has one Keyword on it.

I have a Unity Form that needs to pull that Keyword from the Virtual E-Form, increment it, then save it to the Unity Form.

Then send the incremented keyword back to the Virtual E-Form to save it for the next time the Unity Form is filled out. 

 

How to use Workflow to pull a keyword from a Virtual e-form?

The I will use an action type to increment the keyword and save it on my Unity Form.

Then how do I update the keyword on the Virtual E-Form with the new number?

 

Or is there a better way?

I have a Unity Form that each time it gets finalized by Quality it gets assigned a number that is unique to it, then with each finalized Unity Form that unique number increments by one. I want to automate this so the user(s) doesn't have to keep track of what the next number is, cause there are multiple users who are authorized to finalize this Unity Form.

 

Thanks for any insight

OnBase 22.1

1 ACCEPTED ANSWER

Eric_Simpson1
Star Collaborator
Star Collaborator

There are several actions and rules you may use such as Related Item Exists, Set Property Value, Copy Keyword, Copy Keywords to/from Related Item, Increment/Decrement Keyword, Increment/Decrement Property Value, and Set Keyword from Property Value.  One approach is...

 

1. Initialize a scoped or session property to a default value.  (This defines the keyword outside the scope of the rule in step #2.)

2. Use the Related Item Exists rule to find the E-form as a related document, searching by doc type (you may find a portfolio relation helpful).  Check the Use Related Items for Tasks option.

3. In the On True branch of the rule, copy the value from the E-form keyword to your property, increment it, copy the updated value from the property back to the keyword.

4. Outside of the rule, copy the value from the property to the Unity form.

View answer in original post

6 REPLIES 6

Eric_Simpson1
Star Collaborator
Star Collaborator

There are several actions and rules you may use such as Related Item Exists, Set Property Value, Copy Keyword, Copy Keywords to/from Related Item, Increment/Decrement Keyword, Increment/Decrement Property Value, and Set Keyword from Property Value.  One approach is...

 

1. Initialize a scoped or session property to a default value.  (This defines the keyword outside the scope of the rule in step #2.)

2. Use the Related Item Exists rule to find the E-form as a related document, searching by doc type (you may find a portfolio relation helpful).  Check the Use Related Items for Tasks option.

3. In the On True branch of the rule, copy the value from the E-form keyword to your property, increment it, copy the updated value from the property back to the keyword.

4. Outside of the rule, copy the value from the property to the Unity form.

Thanks @EricS 

I will give this a try! 🙂

@EricS @Scoop Skupien 

I have been trying this and have not been able to get it to work

I created an Ad Hoc task to test this before putting it on a timer

 

f508c22299c64f44b5ef6d2a9e97b757

 

9f59ba874b0441d58b22de1172afee95

 

It skips over Related Item Exist. I used my Unity Form as Primary and Virtual E-Form as the Related Item mapped using a keyword that is set to a default value on both forms. 

 

c8ca349e93e14224a36e5429154910b6

 

d524e10304e0476d8462a08322ccb2e968297141b9cc4750bd82cb88b511b45d

 

 

c3eed7114807461dab1de57c271c357e

 

 

And I get this error in the diagnostic console when it tries to run Copy KW to Unity Form

2e4cf27f72cc474095582d8af02ef8de

 

 

141911cc152d44418b91cdd4df4ecc196e3e0cc4a7bc43b19790f29a37fdddc3

 

Any direction would be great appreciated

 

Thanks

Julie

 

I can get the number to work on the Unity Form using an Auto Keyword (when UF is created) and Custom actions, but there can be multiple Unity Forms in the Workflow at a time and they wont' get finalized in the order they were created. The number needs to be sequential in the order the UF is finalized, not created.

 

Use case:

I have a Unity Form that each time it gets finalized by Quality it gets assigned a number that is unique to it, then with each finalized Unity Form that unique number increments by one. I want to automate this so the user(s) doesn't have to keep track of what the next number is, cause there are multiple users who are authorized to finalize this Unity Form.

> It skips over Related Item Exist. I used my Unity Form as Primary and Virtual E-Form as the Related Item mapped using a keyword that is set to a default value on both forms.

 

Double-check your relation definition.  If the values don't match exactly, or if one is numeric and the other string (for example), it may not be finding any related documents, so the actions under On True wouldn't execute.  Based on the error below though, it does appear to be finding related docs so check that error first.

 

 

> And I get this error in the diagnostic console when it tries to run Copy KW to Unity Form

 

I believe the error is actually from "copy E-Form KW propEFormKW".  Using the Destination Keyword Type from Property option, the property is supposed to have the name of the keyword type you're copying to.  The propEFormKW property has the value "40" so it's looking for a keyword type named "40".  I think this action should be Set Property Value instead to copy the value of the keyword from your e-form to the property.

 

You have the same type of issue in the "Copy new KW to Virtual Form for next UF" action, getting the name of a keyword from the property.  It looks like you want this action to copy the value of the property to a field on your primary Unity form, which "Copy KW to Unity Form" just did, or to the e-form, which was done by "Set KW from propEFormKW value".  Since both of these were just done, this action seems redundant.

 

A note for better performance...

The Copy Property to/from Form Field action copies the value of the property to a form field on the Unity form.  This is a valid way to do it but if the field is keyword backed instead of Disk Group (XML) backed, the Set Keyword from Property Value action is usually much faster.  Writing to a form field, the system has to read the XML file of the form, scan through the file to find that field, update the field value, and write the xml file back to storage.  In contrast, updating a keyword is a simple write to the database, which is usually much faster than processing the text of the XML file.