Building a Recipe

Recipes #

Building a recipe starts on the Recipes tab. Click New Recipe to start creating a new recipe. You can also import a recipe for which you have the recipe json file.

When you click New Recipe, there are 5 options:

New Recipe
  1. Blank Canvas to start from scratch.
  2. Data Aggregation Create a Sliced Bread recipe for performing data aggragation. This wizard will show the Slice Data Into Buckets slicer editor. Once saved, it will automatically add a fully configured JSON Extract rule and create all required virtual fields.
  3. CSV File Create a Sliced Bread recipe for importing a CSV file. This wizard will ask for a CSV file and based on that information will automatically create a Slice File Into Lines slicer, a fully configured CSV Extract rule and create all required fields.
  4. Bulk DML Create a Sliced Bread recipe for performing bulk DML. This wizard will show the Slice Data Into Records slicer editor. Once saved, it will automatically add a fully configured CSV Extract rule and create all required virtual fields.
  5. Generate Data Create a Sliced Bread recipe for generating data. This wizard will automatically create the Generate Slices generator and bread virtual field Number Of Slices.

Recipe Builder #

In the Recipe Builder you will do all your recipe building work.

Recipe Builder
#ElementDescription
1ToolboxThe Elements subtab shows all the Slice, Extract, Transform and Load rule types you can use in your recipe. Just drag and drop a rule type onto the canvas to add a new rule. The Fields subtab shows all the fields in the recipe. Here you can edit virtual fields, delete not-used vitual fields and highlight fields.
2CanvasThis is where you create your recipe. It’s structured into Slice, Extract, Transform and Load like everything else in Sliced Bread.
3Input FieldsFields before the arrow are the Slice Input Fields. These are the Slice fields which the rule will take as input to do its work.
4Output FieldsFields after the arrow are the Slice Output Fields. These are the fields in which the rule will store it’s output. Rules only update output fields if they are blank. If all output fields already have values, the rule will skip because it has no room for its output. The only Slice field that can be updated is Slice Name. We recommend to make use of this exception. A descriptive Slice Name makes all the difference in the Load Plan and other reports.
5Forward ArrowA forward arrow is always displayed between the input and output fields to indicate the direction of the data. For a slice rule a trident-like arrow is displayed instead. This is to depict that this rule makes the transition from one Bread to multiple slices.
6Required Input FieldsSome input fields are marked with a red asterix. These are required input fields, meaning that if one of these fields does not have a value, the rule will be skipped.
7Highlighted FieldsIf you hover over a field, it will highlight all the usages of that field in yellow for input fields or a slightly darker yellow for output fields. You can also click on a field to lock the highlightning for that field. It well then show with a dashed border. Highlighted fields can be handy in understanding quickly how data flows through the Slice fields.
8OrderingJust drag and drop a rule to change the ordering. Rules are always executed top-down.
9Save and Save AsUse these buttons to save your changes. Save can only be used if the current recipe version is not active and has not been active before. With Save As you can either save the recipe as a new version or as a fully new recipe with a different name.
10ActivateWhen your recipe is ready to be used, activate it. It will then show up when you click the “Run a Recipe” button on the Sliced Bread Home tab.
11SettingsClick to change the settings.
12Object IconIf a rule interacts with a specific Standard or Custom object, an icon for that object will be displayed here. It’s there to improve the readibility of the recipe.
13Recipe TypeSliced Bread automatically determines a recipe type for the recipe and displays the outcome here.
14Rule ActionsEach rule has a dropdown with actions. You can find the rule delete action here.

Rule Editor #

You can add a new rule to your recipe by dragging-and-dropping a rule type onto your canvas. You can edit a rule by clicking on the rule name. Each rule type has a different editor, but the layout in general is the same.

Rule Editor
#ElementDescription
1Slice Fields PanelThis displays all the slice and bread fields you can use in defining the rule. Use the Add buttons next to Slice Virtual Fields and Bread Virtual Fields to create a new virtual field. For Bread-level fields only virtual fields are currently supported, not standard or custom fields.
2Right PanelThe right panel content is different per rule type. The variants are: (1) All object fields if the rule type has a related object, (2) All formula operators or functions if the rule type has a formula or (3) blank otherwise.
3Label and NameEach rule has a label and name. Sliced Bread automatically suggests a descriptive label and name and often his suggestion will be fine. But you can change the label and name with the edit button.
4Field ContainerConfiguring Sliced Bread rules consists for a big part of defining which Slice, Bread or object fields play a role in the rule and how. This can be easily done by dragging this fields from the left or right panel into a Field Container. Field containers are quite smart in only allowing the fields that will actually work when being used.
5Selected Field ContainerYou can select a Field Container by cliking on it. It will then show as selected, but more importantly, it will only show the fields in the left and right panel that can be dropped into this container.
6Form ButtonsUse the Cancel button to cancel the current rule creation or editing. Nothing will have changed. Use the Create button to create a new rule. The Apply button will update a rule.
7Tabs: Details, Advanced, PlaygroundDetails is the main tab and this is where you normally configure the rule. The Advanced tab contains the more advanced configuration options. We don’t expect you to be here often. Transform rule tyes have a Playground tab. Here you can directly test your configuration without making any data changes.

Rule Types #

Slice #

Slice File Into Lines #

This slicer downloads a file from Salesforce and then creates a Slice for each line in the file. Raw Data will contain the line as-is with possibly also a header added for context. Use this slicer for processing CSV files or any other file format that bundles data in single lines.

This slicer takes the File linked to the Bread record. If there are multiple Files linked, the bread will fail.

Slice Data Into Records #

This slicer executes a SOQL query on Salesforce and then creates a Slice for each record in the result set. Raw Data will contain the record information in CSV format with a header line. Use this slicer if you want to perform bulk DML.

Make sure that one of the object fields in the WHERE clause is indexed. If not, this slicer may stop working if the number of records gets too big. An indexed object field is displayed in bold in the WHERE clause.

This slicer stores the generated SOQL query which it will execute in field Bread > Query.

Slice Data Into Buckets #

This slicer will execute a SOQL query and gets the full result set. It will then start grouping the results into buckets and calculate sum, min, max, count, count distinct, etc.. Per bucket it will create a slice. Raw Data will contain the bucket infomation in JSON format.

Make sure that one of the object fields in the WHERE clause is indexed. If not, this slicer may stop working if the number of records gets too big. An indexed object field is displayed in bold in the WHERE clause. This need for indexing does not apply to the GROUP BY fields, as grouping is done on AWS.

This slicer stores the generated SOQL query which it will execute in field Bread > Query.

Generate Slices #

This slicer generates a specified number of empty slices. Raw Data will be empty.

Extract #

CSV Extract #

This rule parses a CSV line stored in Raw Data and stores the result in slice fields. This rule can work with both a header line in combination with column names, as well as with a without header line and column numbers.

JSON Extract #

This rule parses a JSON object stored in Raw Data and stores the result in slice fields. It parses JSON using JSON Path. Only the dot-notation is currently supported, e.g.: $.store.book.title.

Transform #

Formula #

This rule calculates the value using a formula and stores the result in a slice field. Which functions & operators are supported can be found in the app in the Functions & Operators panel on the right. A full description can be found under the i icon.

Query #

This rule finds one or more values by executing a query directly against the Salesforce database. Results are stored in slice fields.

Make sure that one of the object fields in the WHERE clause is indexed. If not, this slicer may stop working if the number of records gets too big.

Validate #

This rule validates the Slice. There are two ways of specifying the error condition:

  1. Required Fields. Validate that all of one or more fields have a value.
  2. Formula. Spot an error with a formula.

You can specify the status of the Slice if the validation fails: Failed if something went wrong that needs troubleshooting, Paused if you want a user to do something or Discarded if you don’t care about this Slice anymore. This means that you can use the Validate rule type not only for validation, but also as way to pause slices or discard them.

Load #

Create Record #

Create a new record in Salesforce. The Id of the created record is stored in the Slice Output Field.

Update Record #

Update an existing record in Salesforce. If you check the Only If Blank checkbox for a certain mapping, then that update will only be made if the field is not filled yet. The rule will skip if there are no changes. This is not checked when generating the load plan, so it can be that the load plan says that an update will occur, but it won’t when loading, because there are no changes.

Upsert Record #

Upsert a record in Salesforce. In the Key column you need to select one of the object fields that will act as the Upsert key, i.e. the field that will drive whether the upsert will be an insert or update. Only External Id fields or standard fields with the idLookup property set to true can be the key.

Delete Record #

Delete an existing record in Salesforce.

Virtual Fields #

Virtual fields are fields that fully live in Sliced Bread and are part of the recipe. Virtual fields exist both on Slice-level and Bread-level. You will use the Slice virtual fields the most, but some information is bread-level by nature, because it contains some information that needs to be the same for all slices.

Save Window #

Pressing the Save As button (or Save button first time for a new recipe) will open the following pop-up window.

Save Recipe
#ElementDescription
1Recipe LabelGive your recipe a descriptive name.
2Recipe NameEach recipe also must have a name. The name is mostly important for Sliced Bread automation.
3DescriptionGive your recipe a description to help orient other users or remind yourself later of the purpose of this recipe.

Settings Window #

Pressing the Settings button will open the following pop-up window.

Settings
#ElementDescription
1Auto LoadCheck this setting if want to skip the go/no-go after when Transform is done and you directly want to start loading when the Bread reaches status Ready To Load.
2Batch SizeThis defines the number of slices handled by one Apex Job. The default is 50 and that should normally be fine. Make it lower if you encounter governor limits like the “Apex CPU Time Limit Exceeded” limit.

Advanced Features #

Entry Conditions #

For each rule you can specify an entry condition. When running the recipe, the rule will be skipped if the entry condition is false or blank.

You can specify the entry condition by dropping a checkbox field in the Entry Condition field container which can be found under the Advanced tab in the rule editor. Typically you would create a checkbox virtual field first and add a formula rule to calculate the entry condition.

Rule Editor - Entry Condition

On the Recipe Builder canvas the entry condition is also shown.

Recipe Builder Canvas - Entry Condition

Copyright © 2024 all rights reserved, powered by Sliced Bread Software B.V.