Counting Completed Documents: Difference between revisions
No edit summary |
No edit summary |
||
(One intermediate revision by the same user not shown) | |||
Line 10: | Line 10: | ||
[[File:Image 1.png|thumb|Flow Trigger]] | [[File:Image 1.png|thumb|Flow Trigger]] | ||
Line 26: | Line 25: | ||
[[File:Get Docs Form Document Pack.png|thumb|Flow Step - 1.1]] | [[File:Get Docs Form Document Pack.png|thumb|Flow Step - 1.1]] | ||
Line 34: | Line 33: | ||
Line 42: | Line 43: | ||
[[File:Assignment Component.png|thumb|Flow Step 1.3 (“Doc + 1” Assignment Component)]] | [[File:Assignment Component.png|thumb|Flow Step 1.3 (“Doc + 1” Assignment Component)]] | ||
Line 56: | Line 57: | ||
Line 63: | Line 63: | ||
[[File:RequiredDocs.png|thumb|Flow Step - 1.5 ("RequiredDocs")]] | [[File:RequiredDocs.png|thumb|Flow Step - 1.5 ("RequiredDocs")]] | ||
Line 72: | Line 73: | ||
In the second block, we use the Get Records component get all the Document Submissions related to the Document Assignment that is associated with the triggering Document Submission record (use Flow Step - 1.6 below as a reference). We also use the Loop, the Decision, and the Assignment components to loop through each Document Submission record and to set Flow variables that determine if there are documents missing and calculate the Document Assignment completion percentage (use Flow Step - 1.7 to 1.11 as a reference). | In the second block, we use the Get Records component get all the Document Submissions related to the Document Assignment that is associated with the triggering Document Submission record (use Flow Step - 1.6 below as a reference). We also use the Loop, the Decision, and the Assignment components to loop through each Document Submission record and to set Flow variables that determine if there are documents missing and calculate the Document Assignment completion percentage (use Flow Step - 1.7 to 1.11 as a reference). | ||
Flow Step - 1.7 - "''loop Actual Submissions''” Loop Component - In this component, we loop through the submissions and count unique, non-rejected items. | |||
Flow Step - 1.8 ''- “Submission Status”'' Decision Component – In this component, we check the status of the Submission and ignore any that are rejected. | |||
Flow Step 1.9 ''- “Unique Status”'' Decision Component – In this component, we check if a Submission belonging to the same Document has already been processed. Note that we use a variable called “DocumentIds” in the check. The configuration of the “DocumentIds” variable can be found in Flow Step 1.12. | |||
[[File:Screenshot 6 (“get Submissions” Get Records Component).png|thumb|Flow Step - 1.6 (“get Submissions” Get Records Component)]] | |||
[[File:Screenshot 7 (“loop Actual Submissions” Loop Component).png|alt=|thumb|Flow Step - 1.7 (“loop Actual Submissions” Loop Component)]][[File:Screenshot 8 (“Submission Status” Decision Component ).png|thumb|Flow Step 1.8 (“Submission Status”) Decision Component]] | |||
[[File:Screenshot 9 (“Unique Status” Decision Component).png|thumb|Flow Step 1.9 (“Unique Status” Decision Component)]] | |||
[[File:Screenshot 10 (“Submission + 1” Assignment Component).png|thumb|Flow Step 1.10 (“Submission + 1” Assignment Component)]] | |||
Line 108: | Line 108: | ||
[[File:Screenshot 11 (“Unique Storage” Assignment Component).png|thumb|Flow Step - 1.11 (“Unique Storage” Assignment Component)]] | |||
Line 119: | Line 118: | ||
Flow Step 1. | Flow Step 1.10 - “''Submission + 1”'' Assignment Component – In this component, we set two Flow variables i.e. “SubmissionCount” and “RequiredDocs”. The configuration of | ||
the “SubmissionCount” variable can be found in Flow Step 1.13 below. The configuration of the “RequiredDocs” variable was provided in Flow Step 1.5 above. Note also that we use a Formula variable - i.e. “OutstandingItems” - to set the “RequiredDocs” variable. The configuration of the “OutstandingItems” formula variable can be found in Flow Step 1.14 | |||
Flow Step 1. | |||
Flow Step 1.11 - (“''Unique Storage” Assignment Component'' – In this component, we store variables about the Document Submission to check uniqueness as we loop. The variables we use for storage in this component are “DocumentIds” and “RequiredDocs”. The configuration of the “DocumentIds” variable can be found in Flow Step 1.12 below; the configuration of the “RequiredDocs” variable can be found in Flow Step 1.5 above; and the configuration of the “OutstandingItems” formula variable can be found in Flow Step 1.14. Note also that we use a Formula variable - i.e. “DocumentId” - to set the “DocumentIds” variable. The configuration of the “DocumentId” formula variable can be found in Flow Step 1.15) | |||
Line 134: | Line 131: | ||
Line 142: | Line 138: | ||
[[File:Screenshot 13 (“SubmissionCount” Variable).png|thumb|Flow Step -1.13 (“SubmissionCount” Variable)]] | [[File:Screenshot 13 (“SubmissionCount” Variable).png|thumb|Flow Step -1.13 (“SubmissionCount” Variable)]] | ||
Line 151: | Line 145: | ||
[[File:Screenshot 14 (“OutstandingItems” Variable).png|thumb|Flow Step 1.14 (“OutstandingItems” Variable)]] | [[File:Screenshot 14 (“OutstandingItems” Variable).png|thumb|Flow Step 1.14 (“OutstandingItems” Variable)]] | ||
Line 159: | Line 151: | ||
[[File:Screenshot 15 (“DocumentId” Variable).png|thumb|Flow Step 1.15 (“DocumentId” Variable)]] | [[File:Screenshot 15 (“DocumentId” Variable).png|thumb|Flow Step 1.15 (“DocumentId” Variable)]] | ||
Line 172: | Line 159: | ||
The fields that are updated in this component determine how complete is the Document Assignment. | The fields that are updated in this component determine how complete is the Document Assignment. | ||
[[File:Screenshot 16 (“Add Completeness” Update Records Component).png|thumb|Flow Step - 1.16 (“Add Completeness” Update Records Component)]] | [[File:Screenshot 16 (“Add Completeness” Update Records Component).png|thumb|Flow Step - 1.16 (“Add Completeness” Update Records Component)]] | ||
Flow Step 1.16 - (''“Add Completeness”'' Update Records Component) | Flow Step 1.16 - (''“Add Completeness”'' Update Records Component) | ||
Line 186: | Line 171: | ||
[[File:Screenshot 17 (“Complete c” Custom Field).png|thumb|Flow Step - 1.17 - (“Complete__c” Custom Field)]] | [[File:Screenshot 17 (“Complete c” Custom Field).png|thumb|Flow Step - 1.17 - (“Complete__c” Custom Field)]] | ||
[[File:Screenshot 18 (“Outstanding Items c” Custom Field).png|thumb|Flow Step -1.18 - (“Outstanding_Items__c” Custom Field)]] | |||
Line 195: | Line 180: | ||
[[File:Screenshot 19 (“CompleteCalc” Variable).png|thumb|Flow Step - 1.19 (“CompleteCalc” Variable)]] | |||
[[File:Screenshot | |||
Line 206: | Line 189: | ||
Latest revision as of 02:28, 20 June 2024
Intro
This is a guide to system admins to help them count submitted documents in 3B Onboarding, versions 6 and lower.
With the launch of the new 3B Portal UI, the Document Assignment Completeness and Status must be now managed via custom automation.
This document provides the details of two Salesforce Flows that used as a guidance to implement the automation required to manage the Document Assignments Completeness and Status
Flow to manage the Document Assignment Completeness
As depicted in the picture below, the Flow is triggered when a Document Submission is created or edited, with no entry conditions defined.
Then, the Flow is broken into 3 blocks.
First Block
In the first block, we use the Get Records component to get all the Documents from the Document Pack that is associated with the triggering Document Submission record (use 'Flow Step -1.1' below as a reference).
We also use the Loop and the Assignment components to loop through each Document record and set a couple of Flow variables (use 'Flow Step -1.2' and 'Flow Step -1.3' below as a reference).
In the “Doc + 1” Assignment Component, we set the “DocCount” variable which is used to count the number of Documents associated with the Document Pack. We also set the “RequiredDocs” variable which is used to store the names of all Documents associated with the Document Pack. The Screenshot 'Flow Step 1.4' and 'Flow Step 1.5' below show how the above-mentioned Flow variables are configured.
Second Block
In the second block, we use the Get Records component get all the Document Submissions related to the Document Assignment that is associated with the triggering Document Submission record (use Flow Step - 1.6 below as a reference). We also use the Loop, the Decision, and the Assignment components to loop through each Document Submission record and to set Flow variables that determine if there are documents missing and calculate the Document Assignment completion percentage (use Flow Step - 1.7 to 1.11 as a reference).
Flow Step - 1.7 - "loop Actual Submissions” Loop Component - In this component, we loop through the submissions and count unique, non-rejected items.
Flow Step - 1.8 - “Submission Status” Decision Component – In this component, we check the status of the Submission and ignore any that are rejected.
Flow Step 1.9 - “Unique Status” Decision Component – In this component, we check if a Submission belonging to the same Document has already been processed. Note that we use a variable called “DocumentIds” in the check. The configuration of the “DocumentIds” variable can be found in Flow Step 1.12.
Flow Step 1.10 - “Submission + 1” Assignment Component – In this component, we set two Flow variables i.e. “SubmissionCount” and “RequiredDocs”. The configuration of
the “SubmissionCount” variable can be found in Flow Step 1.13 below. The configuration of the “RequiredDocs” variable was provided in Flow Step 1.5 above. Note also that we use a Formula variable - i.e. “OutstandingItems” - to set the “RequiredDocs” variable. The configuration of the “OutstandingItems” formula variable can be found in Flow Step 1.14
Flow Step 1.11 - (“Unique Storage” Assignment Component – In this component, we store variables about the Document Submission to check uniqueness as we loop. The variables we use for storage in this component are “DocumentIds” and “RequiredDocs”. The configuration of the “DocumentIds” variable can be found in Flow Step 1.12 below; the configuration of the “RequiredDocs” variable can be found in Flow Step 1.5 above; and the configuration of the “OutstandingItems” formula variable can be found in Flow Step 1.14. Note also that we use a Formula variable - i.e. “DocumentId” - to set the “DocumentIds” variable. The configuration of the “DocumentId” formula variable can be found in Flow Step 1.15)
Third Block
In the third block, we use the Update Records component to update a couple of custom fields in the Document Assignment record associated with the triggering Document Submission (use Flow Step 1.16 below as a reference).
The fields that are updated in this component determine how complete is the Document Assignment.
Flow Step 1.16 - (“Add Completeness” Update Records Component)
The custom fields “Complete__c” and “Outstanding_Items__c” must be added to the Document Assignment object. The “Complete__c” custom field is a field of type “Percent” and the “Outstanding_Items__c” custom field is a field of type “Long Text Area” (use Flow Step 1.17 and Flow Step 1.18 below as a reference).
Note also that the “Complete__c” custom field is set using a Formula variable i.e. “CompleteCalc”. The configuration of the “CompleteCalc” variable can be found in Flow Step 1.19.
Flow to manage the Document Assignment Status
The Flow to manage the Document Assignment Status is very simple.
It is triggered when the “Complete__c” custom field in the Document Assignment record is updated.
Then, we use a Decision component to determine whether the assignment is completed or not. If the assignment is completed, then the corresponding Update Records component sets the Status field to “Submitted”.