cancel
Showing results for 
Search instead for 
Did you mean: 

DFD Setup: Requiring Fields...Conditionally

RobertStephens
Level 5
To preface, I saw a discussion between @BenLyons and @Kalash Shamra, about "Conditional Mandatory checks on DFD"  I think we are (or he was) in a similar situation.

I have a pretty simple process that is scanning incoming documents for four fields.  The first two fields are required, and the first has an additional formatting requirement (to align to our Purchase Order numbers).  Sometimes, though, a completely unrelated documents gets ingested that the Business just wants to discard.  Deleting these documents/batches in Decipher creates QC issues later in the process.  Currently, in these instances, the Business needs to enter "99999999999" in the first field, any value for the second and then the word 'Delete' (in any form) the last field.  That allows the document to pass through Decipher and then Blue Prism can determine what to do with it.  And, this works okay.

Recently, though, my teammate and I were talking about a Decipher process he is developing and somehow the idea of a checkbox came up.  (I feel a little ashamed I did not think of it sooner.)  I have now built the checkbox, called 'Discard Document' and set it to default to 'false/unchecked'.  All good.  In the worst case scenario, the user checks the box, saves and returns the Batch and moves onto the next one.  I suppose I could create an additional Blue Prism process to log in and mimic the manual steps described above, but that seems over-engineered.

What I am hoping to do is make it so that if the 'Discard Document' checkbox is 'true/checked', then the first two fields are no longer required.  I have been trying different combinations of 'Dependent Items' and 'Formulas', but nothing seems to be doing the trick.  Is this possible?

Thanks,
Red​
Robert "Red" Stephens Application Developer, RPA Sutter Health Sacramento, CA
9 REPLIES 9

BenLyons
Staff
Staff
Hi Red,

Apologies for the delay, I've been on annual leave.

Just to confirm my understanding, you have set a Formatting Condition (Regex) for the PO Number? The field is both required and must adhere to that format.

I don't believe it's possible to use another field to affect those conditions, but there might be a work around.

If you're using Decipher 2.1 it might be possible to use a Regex formula in a separate field to achieve it.

With 3 fields created, PO Number, PO Calc and Discard.

PO Number should have the Formatting Condition and Required flag removed, this will be handled in the calc.

PO Calc should be required and use a Regexsearch formula to extract the value from the PO Number field. In the event nothing is found it is therefore blank. The calc should include an IF statement to check if Discard is checked and if so populates a dummy PO number or similar.

E.g. IF(EQ(Discard, "True"), "No PO", REGEXSEARCH(PO Number, "PO Regex"))

The initial EQ statement may need a little bit of tweaking as I've not used it with a checkbox.

Let me know if that's along the right line and how you get on.

Thanks

Ben
Ben Lyons Senior Product Specialist - Decipher SS&C Blue Prism UK based

Hi, Ben and Robert,

did you make this work? I would need something similar - checkbox to set that the field does not have to have a value and I can make it not required.

I can't make it work with the formula presented by Ben below.

Thanks.

Regards

Zdenek

RobertStephens
Level 5
@Zdeněk Kabátek, the short answer is 'no', but I am actually a bit further back than I expected.

My extrapolation of @BenLyons' response is that for each value that you would like altered by the checkmark, you will need two fields in the DFD: a 'Read' and a 'Calculated' field (or as I put it, and 'In' and 'Out' version of each).  I believe the other mechanic necessary is that the 'Read/In' fields are NOT required, but the 'Calculated/Out' fields are 'Required'.  I did this, and finally was able to get a version of the Formula that passed the validation for each 'Calculated/Out' field.  It basically says, if the checkmark is 'true', then use a set value (to pass validation), otherwise use the value from the analog 'Read/In' field.

The reason I am further back is that the 'Read/Out' versions of the fields are not getting populated, regardless of the state of the checkbox.  I have set these fields to various combinations of 'Calculable', 'Autocalculate' and 'Virtual' , and even used the 'mapping' functions to (in my mind) directly push the ​value from the 'Read/In' field to the 'Calculated/Out' field, but nothing is showing up...at all.

Where I thought I was going to be, and what I have yet to be able to test, is that, based on the default value of the checkbox, all of the 'Calculated/Out' field​s would be populated with their 'Read/In' analog values.  After failing validation, the end-user would select the checkbox, indicating that the document should be discarded downstream.  My concern is that, even if the formula is written correctly, the change of state of the checkbox will not cause the 'Calculated/Out' fields to be re-evaluated while in its current pass at Data Validation.  Said differently, my concern is that the document would need to circle back to a previous step and come back into Data Verification in order for the now 'checked' box to have the desired effect.

I will include screenshots of the DFD, one sample of the formula (they are all nearly identical) and what I am seeing in the Data Verficiation screen.  (As a note, the 'Read/In' values are entirely correct, and would pass the current logic.)  I am wholly open to User Ignorance as the root cause, but it all seems pretty straightforward, even if this may not be the most elegant approach.  Feel free to point out anything I may have done wrong.

Thanks.
Red
Robert "Red" Stephens Application Developer, RPA Sutter Health Sacramento, CA

Hi, Robert,

that is exactly what I tried but I can't get the autocalculation working. It does not reflect changing the checkbox status (checked vs. unchecked). I even tried the combo box values but it does not work properly either.

This is driving me crazy.

@Ben Lyons - can you shed some light on this? Or anyone else?

Thanks.

Regards

Zdenek​

Hi, Robert,

I gave it another 30 minutes and I made it work. Not sure if it can work for you but let me describe what I had to do.

1. my field which was required but I do not want it to be required is called Buyer - it can contain value but it may be empty either. I want users to confirm if it is empty that they did not forgot to fill it in.
2. so I created a new field Buyer Empty (previously played with checkbox, checkmark group) but it did not work. I changed it to "plain" Text format.
3. for field Buyer Empty I used Flags Selectable, Required and in options column I typed two options to choose from  - Buyer Empty or Buyer Exists 
4. I specified the default value which can be preferred for users (more often appearing) (in my case Buyer Exists as if the field Buyer is empty it does not allow user to proceed because there will be clash in formula)
5. in formula I entered following IF((EQ(Buyer,""), "Buyer Empty, "Buyer Exists")

So the logic works nicely - when the DFD is applied it automatically fills the Buyer Empty field (drop down) with value Buyer Exists. In case Decipher identifies on the document Buyer everything is fine. If Decipher does not find the field and a user wants to submit the document it will not allow it because he/she must change the value in the drop down intentionally to Buyer Empty.

Uff, not sure if the description is clear. If you need more information or screen shot let me know. 

The main change which made it work was to change the Format of the field from checkmark to Text.

Regards

Zdenek

RobertStephens
Level 5
@Zdeněk Kabátek,

You got me closer, but probably not on the point that you were focused on.  Looking at the syntax you used for the formula, I switched from '(Buyer = "")' to the 'EQ(Buyer,"")' format and that allowed the 'Calculated/Out' fields to be populated.  This, in turn allowed my test document to pass through verification without manual intervention.  At least, I am back to zero,  Nice.

Now where I am at is if the checkmark, or even a default text field, is changed, it does not appear to recalculate the values (allowing the requirments to be met and to be able to pass it out of verification).​  Still playing with it

Thanks,
Red​
Robert "Red" Stephens Application Developer, RPA Sutter Health Sacramento, CA

Hello, Red,

well, can you send me some screen shots of your configuration? For me it works pretty well so I would like to understand why it does not work for you.

Regards

Zdenek

RobertStephens
Level 5
@Zdeněk Kabátek,

I owe you a couple of apologies.  First, for the delay in responding.  With everything we have going on, I was finally able to get back to this project.  The second is for my stubbornness.​  Given our conversation, and your suggestions, I was not able to understand why I could not make a checkbox status part of my criteria.  And, frankly, I still do not.  Eventually, though, I did switchout the checkbox for a selectable text field ("True"/"False" only), made a minor update to the logic, and, voila, it works near flawlessly.  I showed a prototype to the Business, and they were very happy with the results.  So, thank you!

Happy Holidays,
Red
Robert "Red" Stephens Application Developer, RPA Sutter Health Sacramento, CA

Hi, Red,

I am glad I could help you :)!

All the best in 2023.

Zdenek