# The Blocworx Process Flow

This page sets out to describe the process flow of activity in a bloc. It is a designed as a reference point for when you are setting up a bloc for automated scheduling or data uploading. It is also designed to help you understand what is happening when you open and start using a Bloc.&#x20;

{% hint style="warning" %}
**Note: This page is for anyone who is more interested in the inner workings of Blocworx or is advanced enough in using it that they want more control and understanding of whats going on. You do not need to know or learn the below to use Blocworx.**
{% endhint %}

### Stage 1: Bloc Initialisation

The first part of the process is Bloc Initialisation. In this phase the following occurs:

* All [Autogenerate ](https://manual.blocworx.com/blocworx-documentation/bloc-editor/fields-tools-and-charts/dynamic-output-and-variable-components/auto-generate-field)fields are initialised and given values, e.g. your invoice numbers or any other options you've set on these that are designed to give you values.&#x20;
* All [Date/Time ](https://manual.blocworx.com/blocworx-documentation/bloc-editor/fields-tools-and-charts/input-fields/date-time-selector)field values are set.
* Any default values you've set on various fields, e.g. a [Text field](https://manual.blocworx.com/blocworx-documentation/bloc-editor/fields-tools-and-charts/input-fields/text) or [Multi Button](https://manual.blocworx.com/blocworx-documentation/bloc-editor/fields-tools-and-charts/input-fields/multi-button) field.

### Stage 2: Field Actions, rules and activity

This stage is where the main engine of Blocworx takes place. This is when you either have data from Stage 1, or are entering or changing data. The following apply.&#x20;

{% hint style="info" %}
Please Note, these actions can also be controlled, added, removed and ordered using our new [Manage Field Actions](https://manual.blocworx.com/blocworx-documentation/bloc-editor/managing-a-field/field-parameters/manage-field-actions) parameter.
{% endhint %}

{% hint style="warning" %}
Not all these actions apply all the time. What occurs and doesnt occur depends entirely on your set up and what fields you are using. For example, if you don't have any [Merge Builder](https://manual.blocworx.com/blocworx-documentation/bloc-editor/fields-tools-and-charts/dynamic-output-and-variable-components/field-merge-builder) fields then nothing will happen for that step.
{% endhint %}

1. Apply any [Bartender Field settings](https://manual.blocworx.com/blocworx-documentation/bloc-editor/fields-tools-and-charts/third-party-integration-components/bartender-integration).
2. Build any [Merge Builder Fields](https://manual.blocworx.com/blocworx-documentation/bloc-editor/fields-tools-and-charts/dynamic-output-and-variable-components/field-merge-builder) associated with the data you are manipulating.
3. Build [Linked Data](https://manual.blocworx.com/blocworx-documentation/bloc-editor/fields-tools-and-charts/linked-data-selection-fields/link-data-field) Fields.
4. Apply [Conditional Values](https://manual.blocworx.com/blocworx-documentation/bloc-editor/managing-a-field/field-parameters/conditional-value).
5. Apply [Date Field](https://manual.blocworx.com/blocworx-documentation/bloc-editor/fields-tools-and-charts/input-fields/date-time-selector#initial-field-parameters) Changes if fields affect the date values.
6. Trigger [Blocworx Gateway](https://manual.blocworx.com/blocworx-documentation/bloc-editor/fields-tools-and-charts/third-party-integration-components/blocworx-gateway) calls if instructed to trigger with a field action.
7. Force Numeric Field Options (e.g. set decimal points).
8. Apply [Sub Bloc Data Sending](https://manual.blocworx.com/blocworx-documentation/bloc-editor/fields-tools-and-charts/sub-blocs-tools-components/sub-bloc#initial-parameters) Options.
9. Trigger [Chart Updates](https://manual.blocworx.com/blocworx-documentation/bloc-editor/fields-tools-and-charts/charts-results-and-data-feeds) where set.
10. Apply [Filtering of Data](https://manual.blocworx.com/blocworx-documentation/bloc-editor/managing-a-field/field-parameters/main-field-parameters#data-filtering-field) where set.
11. Apply [Bloc List](https://manual.blocworx.com/blocworx-documentation/bloc-editor/fields-tools-and-charts/sub-blocs-tools-components/bloc-list) settings.
12. Apply [Date/Time Difference ](https://manual.blocworx.com/blocworx-documentation/bloc-editor/fields-tools-and-charts/dynamic-output-and-variable-components/time-date-difference)Field Activity.
13. Update all[ Results Boxes](https://manual.blocworx.com/blocworx-documentation/bloc-editor/fields-tools-and-charts/charts-results-and-data-feeds/results-box).
14. Update all the [dropdown from bloc, autocomplete and radio button from bloc fields](https://manual.blocworx.com/blocworx-documentation/bloc-editor/fields-tools-and-charts/linked-data-selection-fields/dropdown-from-another-bloc).
15. Update [Maths Fields](https://manual.blocworx.com/blocworx-documentation/bloc-editor/fields-tools-and-charts/dynamic-output-and-variable-components/maths-field).
16. Update the [auto generate field](https://manual.blocworx.com/blocworx-documentation/bloc-editor/fields-tools-and-charts/dynamic-output-and-variable-components/auto-generate-field) where the current value is a reference field to that autogenerate field.
17. Call [Rules](https://manual.blocworx.com/blocworx-documentation/bloc-editor/managing-a-field/field-rules).

### Stage 3: Submitting Data: Before and After

These are the activities that happen immediately before data gets submitted. Please note this is not an exhaustive list and other more technical settings take place also.

1. Apply [Cross Bloc Data Updates](https://manual.blocworx.com/blocworx-documentation/bloc-editor/fields-tools-and-charts/sub-blocs-tools-components/cross-bloc-data-updates) where applicable.
2. Send [Mail Alerts](https://manual.blocworx.com/blocworx-documentation/bloc-editor/fields-tools-and-charts/sub-blocs-tools-components/mail-alerts) where applicable.
3. Call any [Blocworx Gateway](https://manual.blocworx.com/blocworx-documentation/bloc-editor/fields-tools-and-charts/third-party-integration-components/blocworx-gateway) fields that were to set to trigger before submitting
4. Data is Submitted: either a a new record or an update takes place.
5. Data is reset and cleared, default values are set again and the cycle starts again.
