Next Step Expression for Partner

We have a partner that needs a "Next Step Expression" for the following scenario:

- Data Model Field is returning a "Y" or "N" after extraction. If the data field returns "N" the item should go to a certain step in the process, if it returns "Y" is goes to a different step.

I feel like this should be fairly simple, but I do not know the syntax...

Best Answer

Answers

  • jlunsfordjlunsford Posts: 108 mod
    Try this should submit expression Try DirectCast(Item, BatchFolder).IndexData.Fields("The field name").Value = "N" and then put the next step as the step for the N value.  Put a step after that for the Y values and use this should submit expression Try DirectCast(Item, BatchFolder).IndexData.Fields("The field name").Value = "Y"
  • tmartintmartin Posts: 82 ✭✭
    So you are saying have a 2 steps in the process, 1 for the "N" values and 1 for the "Y" values, and instead of a next step expression, use a Should submit expression on each step?
  • dearnerdearner Posts: 96 admin
    Just gonna add my two cents here - you might also want to think about a spawn batch with a should submit expression for both Y and N; it might be cleaner to have separate processes for each branch in the decision tree.
  • tmartintmartin Posts: 82 ✭✭
    Is there not a way to write an expression that satisfies this scenario?:

    Last few steps in his process:
    - Data Review
    - Scan
    - Content Action
    - Document Export
    After data review he wants the docs that have a value of "N" to go to Scan then finish out though export
    After Data Review he wants the docs that have a value of "Y" to go to Export

    I feel like it should be something like this but not sure:
     If(DirectCast(Item, BatchFolder).IndexData.Fields("The field name").Value = "N", Scan, Export)

    Thoughts?
  • dearnerdearner Posts: 96 admin
    here's another way to look at this: certain steps are for all docs, certain steps are for docs with value = "N" and certain steps are for docs with value = "Y", right?  In that case, couldn't you just write should submit expressions on the steps that are looking for value = N or value = Y checking for that condition?
  • tmartintmartin Posts: 82 ✭✭
    We are trying this "Should Submit Expression" and apparently the syntax isn't quite right... We get an error when trying to move into this step. Are spaces allowed in the "Field Name" piece? The field name is 3-Way Approval....

    The intelliSense also breaks right before .Value

    Thoughts?
  • dearnerdearner Posts: 96 admin
    Can you paste the exact expression you're using?
  • tmartintmartin Posts: 82 ✭✭
     DirectCast(Item, BatchFolder).IndexData.Fields("3-Way Approval").Value = "N" 
  • dearnerdearner Posts: 96 admin
    Is that on the scan step?  You can only use that expression on a step that runs at the folder scope; scan can only work at the batch level, right?  You might have to spawn to get this to work.
  • tmartintmartin Posts: 82 ✭✭
    He created a ticket with the Helpdesk as this is for a production system, to get more eyes on it. 
  • BradleyBradley Posts: 90 ✭✭✭
    @tmartin,

    Grooper can't move some documents to one step and the remainder of the documents to a different step without using Spawn Batch.

    Having Scan in the middle of the a batch process isn't common. If this is meant to catch documents or pages that are missing from a document and need to exist before export, the documents with an "N" really should be spawned to a different batch process that starts with Scan.

    Spawn Batch has a Filter option for Invalid Items. If the field name is called "SSN", go to the "SSN" Data Field in the Data Model. Add a Validation Expression:

     SSN = "Y"

    Click Save.

    With the Validation Expression set, you can now use the Invalid Items filter option on Spawn Batch. If a document has the "N" value, the Index Data will be set to Invalid, which will cause Spawn Batch to move that document to the new Batch Process. Note: For Data Review, the property "Allow Completion with Invalid Documents" must be set to True, otherwise, the indexer will never be able to complete Data Review.
  • GrooperGuruGrooperGuru Posts: 417 admin
    When I have a single solution that needs to process scanned documents and existing electronic documents through one workflow, I generally will make the first step in the process the scan step, followed immediately by IP (if necessary). Then I'll add the typical pre-processing steps for electronic files like render and content action -> split. Then to Recognize. On the original scan step (or the IP step if used), I add a Next Step Expression that just always goes directly to Recognize. That way if a user just starts a new batch and scans, it will bypass the steps tailored to electronic file processing. When importing an electronic batch into this workflow, I simply select the starting step at Render (or whatever is the first step for handling the electronic content).  This is a pretty simple approach the uses one process for both.
    Matt Harrison
    Director of Strategy
    [email protected]
  • GrooperGuruGrooperGuru Posts: 417 admin
    @tmartin to your earlier comment, you can't use a next step expression here, because as Brad stated you can't break the batch apart without spawning. However, with a Should Submit Expression, this should work just fine. Essentially on the Scan step, you just need to add a Should Submit expression like what you listed like DirectCast(Item, BatchFolder).IndexData.Fields("The field name").Value = "N". The syntax might not be perfect, but the intent of that logic is solid. 
    Matt Harrison
    Director of Strategy
    [email protected]
  • tmartintmartin Posts: 82 ✭✭
    Thanks everyone for the input and it makes sense to me.

    @DungVu does this make sense to you? Will spawning the "N" documents into another batch process work for you?

  • DungVuDungVu Posts: 51

    spawn batch may create confusing by create new batches and difficult for customer to keep track of the batches they are working on (They process more than 20,000 Batches(invoices) per day) and finally, more difficulty later on when run the production report for all processed batches by certain time frame.

    Only a few invoices required to add additional supporting document when PO field lookup from database with flag="N". Therefore, we need a step where user can add additional supporting docs.

    Currently we work around like this:

    @Index data field we set validate expression: _3_Way_Approval = "Y"
    @Data review at "Next step expression" we set: If(Batch.HasFlaggedItems, Scan, Document_Export)

    Thank you.




  • tmartintmartin Posts: 82 ✭✭
    @DungVu
    I think the only way to give you exactly what you need would be the Spawn batch approach. 
    - You can create multiple branches in a workflow within the same process(i.e.different documents going to different steps), by using "Should Submit" expressions. The problem you have , however, is that you want docs at the folder level to be sent to a "Scan" step. This is not possible because the "Scan" step can only be scoped at the batch level. This is why the expression we were testing earlier did not work. 

  • DungVuDungVu Posts: 51
    After spawn batch to different process within scan step and I tried to put at should submit expression with DirectCast(Item, BatchFolder).IndexData.Fields("3-Way Approval").Value = "Y" but I got error "Object reference not set to an instance of an object"

    Please advise!

    Thanks

Sign In or Register to comment.