Flow Error on Build a Simple Flow - Answers - Salesforce Trailblazer Community
Trailblazer Community
Ask Search:
Michael HaberleinMichael Haberlein 

Flow Error on Build a Simple Flow

Hello,

The Trailhead Module in question is Build a Simple Flow.

I am pulling my hair out due to a flow not working, despite my following the Trailhead module exactly, and even earning the Build a Simple Flow badge, indicating that I did nothing wrong on the module itself.

The error I am receiving is as follows:
Error element Find_a_Match (FlowRecordLookup).
This error occurred when the flow tried to look up records: The flow failed to access the value for contact.FirstName because it hasn't been set or assigned.. You can look up ExceptionCode values in the SOAP API Developer Guide (https://developer.salesforce.com/docs/atlas.en-us.api.meta/api/sforce_api_calls_concepts_core_data_objects.htm" style="color:blue; text-decoration:underline).

Flow Details
Flow API Name: New_Contact
Type: Screen Flow
Version: 2
Status: Inactive
Org: Block Imaging (00D4T000000Fy77)

Flow Interview Details
Interview Label: New Contact 10/10/2019 1:40 PM
Current User: Michael Haberlein (0054T000000wNWk)
Start time: 10/10/2019 1:40 PM
Duration: 13 seconds

How the Interview Started
Michael Haberlein (0054T000000wNWk) started the flow interview.

SCREEN: Contact_Info
Lightning Component: contactName
Screen component: flowruntime:name
Inputs:
firstName = contact.FirstName ()
lastName = contact.LastName ()
Outputs:
disabled = false
fieldsToDisplayList = firstName,lastName
firstName = Lisa
informalName =
label = Name
lastName = Ling
middleName =
readonly = false
salutation =
salutationOptions = Mr.,Mrs.,Ms.
suffix =

Dropdown List: Account
Label: Account
Data Type: Text
Choices selected at runtime:
Choice selected at runtime: Grand Hotels & Resorts Ltd (accounts)
Choice value: 0014T00000469A5QAI
Stored field values:
{!contact.AccountId} = Id (0014T00000469A5QAI)


Lightning Component: update_toggle
Screen component: flowruntime:toggle
Inputs:
label = (If this contact already exists, update the existing record.)
messageToggleActive = (Update Existing)
messageToggleInactive = (Create other Contact)
value = updateExisting (null)
Outputs:
label = If this contact already exists, update the existing record.
messageToggleActive = Update Existing
messageToggleInactive = Create other Contact
value = false

Selected Navigation Button: NEXT

GET RECORDS: Find_a_Match
Find one Contact record where:
FirstName Equals {!contact.FirstName} (<contact.FirstName couldn't be resolved>)
LastName Equals {!contact.LastName} (<contact.LastName couldn't be resolved>)
Result
Failed to find record.

Error Occurred: The flow failed to access the value for contact.FirstName because it hasn't been set or assigned.

Salesforce Error ID: 1799991688-82753 (802446044)


So looking at the error, it is indicating that I did not set the value for Contact.FirstName, an that the error itself is occurring on the Find_a_Match element, which is a Flow Record Lookup.

However, I input the values in exactly the manner instrcuted by the Trailhead module, and as afore-mentioned have passed the module itself indicating I did indeed follow the instructions correctly.

User-added image
User-added image

I have no idea what to do now, as I need this flow to be running correctly in order to move onto the Flow Builder module, as this Flow is used in that module.

If anybody has any suggestions I would appreciate it.

 
Best Answer chosen by Jayson (salesforce.com) 
Will BissettWill Bissett
Hi Michael,

I had this problem too; I'd followed all the steps correctly (so I thought) passed the assessments and got the badge, but running the flow in debug mode I got the same result as you:

Error Occurred: The flow failed to access the value for contact.FirstName because it hasn't been set or assigned.

After some investigation I found that when setting the properties on the Name Input Component I had added the contact.FirstName and Contact.LastName to the wrong fields; I hadn't put them under the 'Store Output Values to Select Variables', but had put them in similar fields at the top of the column.  See 'Collect Contact Info from Your User' section 6a. and 6b.  ... that might solve your problem.  It solved it for me and it now works.  Hope that helps.


 

All Answers

Marco SolisMarco Solis
Hi Michael, you're very close. 
Simply add the fields to the "Select Variables to Store Contact Fields", otherwise they'll be null
Arijit MajeeArijit Majee
why this flow is inactive? Are you getting this error message during testing/running the flow?
Will BissettWill Bissett
Hi Michael,

I had this problem too; I'd followed all the steps correctly (so I thought) passed the assessments and got the badge, but running the flow in debug mode I got the same result as you:

Error Occurred: The flow failed to access the value for contact.FirstName because it hasn't been set or assigned.

After some investigation I found that when setting the properties on the Name Input Component I had added the contact.FirstName and Contact.LastName to the wrong fields; I hadn't put them under the 'Store Output Values to Select Variables', but had put them in similar fields at the top of the column.  See 'Collect Contact Info from Your User' section 6a. and 6b.  ... that might solve your problem.  It solved it for me and it now works.  Hope that helps.


 
This was selected as the best answer
Kumar SuyashKumar Suyash
@Will Bissett 

Thanks a lot for sharing your experience as same issue I have also faced and solved it by going throungh the same.
 Need to put under Store "Output Values to Select Variables" instead of 'Collect Contact Info from Your User' 
Venkata Subbarao GorantlaVenkata Subbarao Gorantla
@Will Bissett

Thank you brother!
Ankit ThakkarAnkit Thakkar
Thank you for sharing the details and it worked. 

Cheers!! 
Ankit ThakkarAnkit Thakkar
It has resolved the issue while creating new contact but while updating the existing records, it is giving below error:

How the Interview Started
Ankit Thakkar (0052x000000w0sl) started the flow interview.

SCREEN: Contact_Info
Lightning Component: contactName
Screen component: flowruntime:name
Inputs:
firstName = contact.FirstName (Nilesh)
lastName = contact.LastName (Thakkar)
Outputs:
firstName = contact.FirstName (Nilesh)
lastName = contact.LastName (Thakkar)

Dropdown List: Account
Label: Account
Data Type: Text
Choices selected at runtime:
Choice selected at runtime: GenePoint (accounts)
Choice value: 0012x0000045MoVAAU
Stored field values:
{!contact.AccountId} = Id (0012x0000045MoVAAU)


Lightning Component: update_toggle
Screen component: flowruntime:toggle
Inputs:
label = (If this contact already exists, update the existing record.)
messageToggleActive = (Update Existing)
messageToggleInactive = (Create other contact)
Outputs:
label = If this contact already exists, update the existing record.
messageToggleActive = Update Existing
messageToggleInactive = Create other contact
value = true

Selected Navigation Button: NEXT

FAST LOOKUP: Find_a_Match
Find all Contact records where:
FirstName Equals {!contact.FirstName} (Nilesh)
LastName Equals {!contact.LastName} (Thakkar)
Sort records by: AccountId (Ascending)
Store the values of these fields in Find_a_Match: Id
Result
Successfully found records.

DECISION: Update_or_Create
Outcome executed: Update_Existing
Outcome conditions:
1. {!update_toggle.value} (true) Equals true
2. {!Find_a_Match} ([Contact (0032x000001xWyuAAE)]) Is null false
Logic: All conditions must be true (AND)

Error element Contact_Info (FlowScreen).
class java.util.ArrayList cannot be cast to class common.apex.runtime.SObjectRow (java.util.ArrayList is in module java.base of loader 'bootstrap'; common.apex.runtime.SObjectRow is in unnamed module of loader org.eclipse.osgi.internal.loader.EquinoxClassLoader @60d1a32f)

Can you please suggest?
Abhishek SaxenaAbhishek Saxena
Hey Michael Haberlein 
I am also facing this same problem I suggest you to see the screen node. You should enter first name and last name here too.
Regards 
AbhishekUser-added image
Munira MajmundarMunira Majmundar
Thank you guys for this thread! Because of it, I solved the similar problem! On to the next module!!
Smita HodiggeriSmita Hodiggeri
Was stuck with same issue. Solved it, Thanks Will!
Pallavi DahorePallavi Dahore
Hey I have added those value from section 6a and 6b as mentioned by Will, But still getting error in the contact info section can anyone help what am I missing here.User-added imageUser-added imageUser-added image
Layla NessLayla Ness
Thanks for asking this! - I had the same issue which was resolved by adding the First and Last Name values to 'Store Output Values to Select Variables' as suggested above. Here's the URL to go back to step 6a on the trailhead unit 'Collect Contact Info from Your User': https://trailhead.salesforce.com/en/content/learn/projects/build-a-simple-flow/collect-contact-info-from-your-user?trail_id=build-flows-with-flow-builder
Layla NessLayla Ness
Hey Pallavi - I think the steps are a bit confusing, according to the screen shot at step 3 you still need the First Name and Last Name populated above like this, I noticed these weren't populated on your screen grabs.
 User-added image
Jessica PereiraJessica Pereira

I was doing the same trailhead and this was very helpful BUT you ONLY have to do the following, if you already followed the trailhead correctly:

 

On the First Screen, when you dragged the "New Contact" - "Name" , on the "Store Output Values to Select Variables" , you need to add the variables there:

Imagem adicionada pelo usuário