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
BobPBobP 

The flow failed to access the value AccountId because it hasn't been set or assigned.

I have a screen flow that is giving my a headache. No matter what i do to change the variable to set the account from a contact it is still giving me this error.
The flow failed to access the value for Get_Contact_Id.Account.Id because it hasn't been set or assigned.
I am trying to create a record from a contact record for a custom object but I cant figure out why it isnt setting the AccountId from my Get Contact Id element
User-added image
Create record element
User-added image

 
Naveen KNNaveen KN
have you tried just with {!get_contact.AccountId} instead of get contact > accound id > account id 

please try this and let us know if it works.
 
BobPBobP
Hi Naveen, 
Similar message Error Occurred: The flow failed to access the value for Get_Contact_Id.AccountId because it hasn't been set or assigned.

Naveen KNNaveen KN
it might be not getting the contact record and we are trying to access the account id from the null contact object. Please debug flow directly and check each node output. 
BobPBobP
User-added image
User-added image
Naveen KNNaveen KN
I see transactions committed. Did it throw the error which you mentioned in the question description while debugging the flow?

and one more observation - why are we again querying the account object. As we get Account Id from the Contact query, directly we can use that acccountId to create a compliance record? 
Victor De PrecigoutVictor De Precigout
Hello,

I have the same issue with a ServiceApointment creation using Salesforce Scheduler :
I added a SendEmail action at the very end of the flow, and I wanted to add the ServiceAppointment number created during the flow interview as part of the email body (so I added it to my TextTemplate using {!ServiceAppointment.AppointmentNumber}). 
But I got the same message "The flow failed to access the value for ServiceAppointment.AppointmentNumber because it hasn't been set or assigned."

How is it possible that this AppointmentNumber hasn't been set as the ServiceAppointmentNumber is created before (during the SaveApppointment action) and it's an autonumber field ?

Thank you for advance if you have any idea on how to refer to this AppointmentNumber...
Best,
Victor