You are viewing limited content. For full access, please sign in.

Question

Question

Set Business Process Variables to set table values to null in a form

asked on June 20, 2016

Hello , first time poster.

I am having issues with resetting values in a form back to null.

Some context we are using a form that collects item numbers daily so i need to create a task for next day with item numbers cleared from the same form.

Using the Business Process Variables, i have had success with a single field , but having trouble with only resetting the top line of a table and leaving next rows as per previous form submission.  (FYI :multi value for an item (drop down value ) and description (just text). From researching , I have added for each row 

in the workflow but still not working.

Hopefully I have described well enough

thanks

Grant

 

0 0

Answer

SELECTED ANSWER
replied on August 10, 2016

Hi Grant,  actually you don't need to use the output parameters as I posted before, there is a special token provided by workflow that allow you to set field values to blank: it is DB.NULL. You can remove the for each row and assign token values activity and set the variable to use %(DB.NULL), this token will remove values in all the rows.

 

3 0

Replies

replied on June 21, 2016

Hi Grant,

Can you provide more information about your use case? What exactly are you trying to accomplish by setting the form field values to null? If you're trying to route a blank form to a user, you can make a copy of the form then assign it using user task. Let me know if that works for you. Thanks! 

 

0 0
replied on June 21, 2016 Show version history

Hello Ming-lun, unfortunately cannot use blank form , it needs to carry over many details which i have working. Just trying to clear the fields with  information that is in the table. I have no issues clearing out the first row of table but no success clearing out next row info.

 

Hope you can suggest an option thanks.

I put in the email activity to check i was getting each of the multi values of the table. (which worked fine). Here is my BPV setting

0 0
replied on June 23, 2016

Hi Grant, you can add an output parameter with multi-value checked, then add the assign token values inside For each row as following to assign blank value to the parameter, then set the process variable with the output parameter.

 

1 0
replied on August 2, 2016

Hello Xiuhong Xiang, unfortunately this still does not work. The only way i have successfully got it to work was duplicate the starting variable value as null, however this amount of rows are variable.

It seams once i set a business process variable it only ids the first row.

 

Apologies took longer to reply , had been deployed to different project that is now completed. thanks Grant

0 0
replied on August 8, 2016

Hello Xiuhong Xiang , is there a chance i can lodge a support case with you for this?

thanks

Grant

0 0
replied on August 8, 2016

Can you show me which part it doesn't work? I will take a look again.

0 0
replied on August 8, 2016

Ok If i use your process as described it only removes the data from the first row, basically the same outcome I have achieved using various methods (including jscript)

If i duplicate the variable in this screen it deletes second row data, however the amount of rows will be variable.

Help :)

Grant

 

0 0
SELECTED ANSWER
replied on August 10, 2016

Hi Grant,  actually you don't need to use the output parameters as I posted before, there is a special token provided by workflow that allow you to set field values to blank: it is DB.NULL. You can remove the for each row and assign token values activity and set the variable to use %(DB.NULL), this token will remove values in all the rows.

 

3 0
replied on August 10, 2016

Hello Xiuhong Xiang , yes that's it, thank you for following through.

cheers

Grant

0 0
replied on November 14, 2021

Hi @████████

Are the team aware that %(DB.NULL) throws "Set Process Variables" into a loop, and no longer works in Workflow (LF Forms 11 / LF Workflow 11)? 

You can easily reproduce this by creating a test form with a few fields. Trigger a workflow activity to update/clear those fields with %(DB.NULL).

The form submission will work, then the form process will get stuck on the workflow activity.

According to Workflow's logs the process "Completed", but it never updates the LF Forms server and thus LF Forms cannot proceed from the Workflow Activity Step - even if you retry.

Removing %(DB.NULL) reference from the Set Process Variables activity immediately remedies the issue and the process will complete correctly.

The work around for some fields is to set them to

Field_Name= 

(blank/nothing) and it will clear them.

But for example with Rich Text Fields this does not work and the fields "believe" they have been written to with '' and therefore no longer take updates or cues from any conditional logic or lookups on the page. 

Are you able to reproduce the problem? Is there a hot fix available for this problem?

0 0
replied on November 14, 2021

@████████, I can only reproduce this issue with rich text field, other types of fields works well. And I can reproduce this issue with 10.4.5 as well. Of which version it worked for you before?

When it is not working, there is following error in the event log:

Caught exception: Laserfiche.Forms.CommonUtils.Exceptions.LFFormsException
Message: An unexpected error has occurred. [LFF502-UnexpectedError]


Inner exception: System.NullReferenceException
Message: Object reference not set to an instance of an object.
   at E_Forms.Controllers.CallbackController.WFRTFFormatter(HtmlSanitizer sanitizer, String textToSanitize)
   at E_Forms.Controllers.CallbackController.FormatReturnData(SubmissionAttributeData[] maps, String WFDecimalSeparator)
   at E_Forms.Controllers.CallbackController.SubmissionData(HttpRequestBase Request, Int32 mainInstance, Int32 workerInstanceId, String host, String workflowName, Int32 lastSubmission)
   at E_Forms.Controllers.CallbackController.NotifyWorkflowCompleted(Int32 workerId, Int32 mainId, String secretKey, Int32 lastSubmission, Int32 lastLogonUser, Int32 stepId)
   at lambda_method(Closure , ControllerBase , Object[] )
   at System.Web.Mvc.ControllerActionInvoker.InvokeActionMethod(ControllerContext controllerContext, ActionDescriptor actionDescriptor, IDictionary`2 parameters)
   at System.Web.Mvc.Async.AsyncControllerActionInvoker.<>c.<BeginInvokeSynchronousActionMethod>b__9_0(IAsyncResult asyncResult, ActionInvocation innerInvokeState)
   at System.Web.Mvc.Async.AsyncResultWrapper.WrappedAsyncResult`2.CallEndDelegate(IAsyncResult asyncResult)
   at System.Web.Mvc.Async.AsyncControllerActionInvoker.EndInvokeActionMethod(IAsyncResult asyncResult)
   at System.Web.Mvc.Async.AsyncControllerActionInvoker.AsyncInvocationWithFilters.<>c__DisplayClass11_0.<InvokeActionMethodFilterAsynchronouslyRecursive>b__0()
   at System.Web.Mvc.Async.AsyncControllerActionInvoker.AsyncInvocationWithFilters.<>c__DisplayClass11_2.<InvokeActionMethodFilterAsynchronouslyRecursive>b__2()
   at System.Web.Mvc.Async.AsyncControllerActionInvoker.AsyncInvocationWithFilters.<>c__DisplayClass11_2.<InvokeActionMethodFilterAsynchronouslyRecursive>b__2()
   at System.Web.Mvc.Async.AsyncControllerActionInvoker.EndInvokeActionMethodWithFilters(IAsyncResult asyncResult)
   at System.Web.Mvc.Async.AsyncControllerActionInvoker.<>c__DisplayClass3_6.<BeginInvokeAction>b__4()
   at System.Web.Mvc.Async.AsyncControllerActionInvoker.<>c__DisplayClass3_1.<BeginInvokeAction>b__1(IAsyncResult asyncResult)

0 0
replied on November 17, 2021

Thanks for checking into it Xiuhong. My reference of it "no longer working" was based on posts like these and the help guide stating that it should work. I hadn't tried with single line or multiline fields yet, as my requirement was Rich Text. Have you logged this as a bug to be fixed in a future update? Being unable to unset the rich text field using workflow has caused some real obstacles for some of our processes so it would be good to know if a hot fix is possible. 

Thank you!

0 0
replied on November 18, 2021

Yes, it has been logged as a bug and the bug ID is 352037, we will look into it in the coming Forms 11 update 2 and we don't have plan for hotfix yet. 

1 0
replied on February 21, 2022

Setting the value of a rich text field with %(DB.NULL) from workflow no longer generates an error with Forms 11 Update 2(https://support.laserfiche.com/kb/1014352/list-of-changes-for-laserfiche-forms-11-update-2)

2 0
replied on February 21, 2022

I was very pleased to see that in the release notes of the latest update - thank you!

1 0
You are not allowed to follow up in this post.

Sign in to reply to this post.