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
Stewart McNaughtStewart McNaught 

Field Update: Pushing null into a field with flow

I have created a flow that loads data from a custom object called staging plan.

 

  • Staging plan contains fields that are group into the follow sections

Action Plan 1, Action Plan 2 & Action Plan 3

 

  • The user is then asked the type of task they want to create from the data. 

For example: Use select Action Plan 1

 

  • A task is created populated with Action Plan 1 Fields on staging plan.\

 

  • Next the data in the plan fields need to be set to null.

So the four field in Action plan need to be cleared.

 

What variable\constant do I use to remove the previous value and store a null in the field?

Best Answer chosen by Admin (Salesforce Developers) 
Stewart McNaughtStewart McNaught

I am using the Cloud Flow designer.

Thank you -  Global Constant: EmptyString.

 

I originally though that variable was causing an error, but it turned out to be an error when I am trying to create the TASK record. The WHOID is throwing an error ... AccountID is not valid if account is a person account.

 

To resolve this issue, I added logic to the flow to determine if the account record is a person account using the IsPersonAccount field. If this evaluates as true then I assign the id stored in the account field PersonContactId.

 

 

 

 


All Answers

markross__cmarkross__c

Are you in the Desktop or Cloud Flow Designer?

If you're in the Cloud Designer and this is a text field, try the Global Constant EmptyString. I can't find any documentation on what it does, but I wouldn't be surprised if it emptied the string.

 

As for the Desktop Designer, I'm not sure this will work, but I know for Bulk API calls, you blank out a field by passing the value #N/A to it. This is basically a wild shot in the dark, since I don't think Visual Workflow uses Bulk API on the back end.

Stewart McNaughtStewart McNaught

I am using the Cloud Flow designer.

Thank you -  Global Constant: EmptyString.

 

I originally though that variable was causing an error, but it turned out to be an error when I am trying to create the TASK record. The WHOID is throwing an error ... AccountID is not valid if account is a person account.

 

To resolve this issue, I added logic to the flow to determine if the account record is a person account using the IsPersonAccount field. If this evaluates as true then I assign the id stored in the account field PersonContactId.

 

 

 

 


This was selected as the best answer
MatthewSoutherMatthewSouther
If the field is a date or date/time value, Global Constant EmptyString isn't available.  I have tested and confirmed, however, that leaving the Value column empty (per below) provides the equivalent functionality.

Setting a date/time value to null in Visual Workflow
Nancy Everest --Nancy Everest --
Yes, simply leaving the field blank worked for me to assign a null date. Then when a "Decision" in my flow checked the date field for null, it no longer threw a null exception. Thank you!
Tarak SametTarak Samet
Hello , 

I tested both : 
- Leaving the field blank
- Assigning the global constant : {!$GlobalConstant.EmptyString}

But nothing is working !

The data / value in the field is not removed !

Do you have any other solution / workaround ?

Thank you !