function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
Natalia Rex 1Natalia Rex 1 

Help with adding condition to error: flow failed...because it hasn't been set or assigned.

Hi everyone, I am trying to update a flow that was created, and I believe I know what the problem is and what I need to do, I am just not sure where to add the condition to ignore null/empty field, or what I should update in the flow, so it would ignore an empty field. I've been looking on youtube, articles, and even this board I'm just a little stuck. I had a call w/ support and they suggested to post here.

The flow that we have gets initiated by a process builder, when a task is marked complete (thats all). Then the first action is to load this flow below.

One of the main steps of this flow, is to pull data from our Quote Line Item object, and have it available in the Invoice Line Item and then later on create a task and invoice.

Loop is a new thing for me, I'm stil learning, so bear with me.
In the flow, once the data is checked, it goes into a loop and we have an ASSIGNMENT step, ''Assign Quote Line Item value to Invoice Line Items". The field in particular that I added was a field in Quote called ''Cost Per Hour", that we also want to be available in the Invoice Line Item.
This is the only change I've added to this already existing flow, and this error below is what pops up. I've tried to create a 'decision' step, and entered this below (but the error still occurs). I feel I am close, but have no idea where to start. I'd appreciate your input!

TEST DECISION - DIDNT WORK

test decision - what I tested, with no luck. I'm not sure WHERE to put this.

ENTIRE FLOW

the current flow with some extra info



How the Interview Started
0053X00000B3ZWc) started the flow interview.
Some of this flow's variables were set when the interview started.
process_kick_off_task_id = 00T3X00005QJuiq

FAST LOOKUP: Get_Init_Task
Find all Task records where:
Id Equals {!process_kick_off_task_id} (00T3X00005QJuiq)
Store the values of these fields in Get_Init_Task: Id, WhatId
Result
Successfully found records.

FAST LOOKUP: Get_Init_Project
Find all Project__c records where:
Id Equals {!Get_Init_Task.WhatId} (a023X00001uNPIRQA4)
Store the values of these fields in Get_Init_Project: Id, First_Invoice_Date__c, Project_Owner__c, Partner_Report_Due__c, From_Opportunity__c, Client_Invoice_Receivable_Due__c, TA_Invoice_Due__c, Partner_Invoice_Due__c, Partner_Invoice_Payment_Due__c, TA_Timesheet_Report_Issue_Deadline__c, Partner_Report_TA_Acceptance_Deadline__c, TA_Report_Signoff_Deadline__c
Result
Successfully found records.

FAST LOOKUP: get_won_quote_from_project_opp
Find all Quote records where:
Status Equals Won
OpportunityId Equals {!Get_Init_Project.From_Opportunity__c} (0063X000012B7YEQA0)
Store the values of these fields in get_won_quote_from_project_opp: Id
Result
Successfully found records.

FAST LOOKUP: get_quote_line_items
Find all QuoteLineItem records where:
QuoteId Equals {!get_won_quote_from_project_opp.Id} (0Q03X000002CKz5SAG)
Store the values of these fields in get_quote_line_items: Id, Candidate_number__c, Discount, Talent_Seniority__c, UnitPrice, Talent_Role__c, Talent_Name__c, Quantity, Partner__c
Result
Successfully found records.

CREATE RECORDS: Create_Invoice
Create one Invoice__c record where:
Client_Invoice_Receivable_Due_Date__c = {!formula_client_invoice_rec_due_date} (15 June 2020)
Partner_Invoice_Due_Date__c = {!formula_partner_invoice_due_date} (14 June 2020)
Partner_Invoice_Payment_Due_Date__c = {!formula_partner_invoice_payment_due_date} (15 June 2020)
Partner_Report_Due_Date__c = {!formula_partner_report_due} (07 June 2020)
Partner_Report_TA_Acceptance_Deadline__c = {!formula_acceptance_deadline} (07 June 2020)
Project__c = {!Get_Init_Project.Id} (a023X00001uNPIRQA4)
TA_Invoice_Due_Date__c = {!formula_ta_invoice_due_date} (14 June 2020)
TA_Report_Signoff_Date_Deadline__c = {!formula_signoff_deadline} (07 June 2020)
TA_Timesheet_Report_Issue_Deadline__c = {!formula_timesheet_issue_deadline} (07 June 2020)
Result
A record is ready to be created when the next screen, pause, or local action is executed or when the interview finishes.
{!created_invoice} = a013X00002UFfmDQAT

LOOP: loop_over_quote_line_items
Loop Through: [0QL3X000004yEJNWA2]
Iteration: 0
Current value of {!loop_quote_line_item}: 0QL3X000004yEJNWA2

Error element assign_QLI_values_to_ILI (FlowAssignment).
The flow failed to access the value for loop_quote_line_item.Cost_per_hour__c because it hasn't been set or assigned.

ShirishaShirisha (Salesforce Developers) 
Hi Natalia,

Greetings!

This error occurs whenever the value is coming as Null.So,can you please troubleshoot the decision screen in which you are trying to assign a value for Cost_per_hour__c field.

Reference:

https://help.salesforce.com/articleView?id=000315965&language=en_US&type=1&mode=1

Kindly let me know if it helps you and close your query by marking it as solved so that it can help others in the future.

Warm Regards,
Shirisha Pathuri
Natalia Rex 1Natalia Rex 1

Hello Shirisha, thank you for the reply. Yes, the article above is what I had found, and it gave me a little clearer picture. What I went ahead and did is add another stage "Decision" between Assignment and Create Records (in the loop), that has the following condition:

When to Execute Outcome
When all conditions are met:


{!loop_quote_line_item.Cost_per_hour__c}       Is Null           !$GlobalConstant.True}

I ran the debugger and I did NOT get an error back, which was a nice surpirse. I have yet to active this, so I will try to test this in the end of the week to see if all is OK,