Flow, Resources

Why Are Assignments So Confusing?

I noticed this about a year ago: The assignment element is confusing for most people.

I decided to expand my content to include more detail on the assignment element.

Read until the end to find the link to the infographic on assignments that you can download and keep.

What do they do? ⛖

The assignment element performs mathematical operations and moves data between variables.

What they don’t do 🛑

They don’t evaluate criteria to produce true/false outcomes.

Assignments run from the right side to the left side.Variable1 Add 1 will add 1 to the Variable1 value.Variable1 Equals Variable2 moves Variable2 value to the Variable1.

Popular operators âž•

  • Equals
  • Add
  • Subtract
  • Add Item (Multiselect Picklist)

Popular Collection Operations ðŸŸ°

  • Equals Count
  • Remove Uncommon
  • Remove After First (Text Collections)
  • Add At Start (Text Collections)

Pro Tips ✖

Use two consecutive assignment elements when you need one assignment to execute after another.

Build formula resources for complex statements.

Functions cannot be used directly. Instead, create a formula resource including functions.

Example Use Cases ➗

Counters: Create a number variable with no decimals, and add 1 in each loop iteration.

Blank text variables with an empty right box.

Assign error messages to a variable in the display text component for variable visibility.

Add 1/24 to date-time variables to add an hour.

Use the Equals Count operator to get the count of records in a record variable.➡️

Now head over to https://SalesforceBreak.com to download your infographic. Click on the last menu item on the main page. ➡️

This post was originally made to LinkedIn on January 8th, 2023.

Read the previous post: Hidden Gem in Spring 23: Schedule-Triggered Flow Improvements


One thought on “Why Are Assignments So Confusing?

  1. Pingback: Blog - Salesforce Break

Leave a Reply