+ Start a Discussion
conradvillaconradvilla 

Flow - Clear Input Values

I've written a rather intricate flow which asks a number of questions from the user and then using APEX it creates a record to a custom object, based ont he user input.

 

The issue I face is that at the end of the Flow, I prompt the user to enter another record (against the same Master) and if they answer Yes, the Flow will repeat.  However, it retains all of the prior input.  Is there a way to clear all user input prior to repeating the flow?

Best Answer chosen by Admin (Salesforce Developers) 
Jeff KranzJeff Kranz

I have successfully implemented a workaround for this by separating the input screens and the looping logic into separate flows, and using the input screens flow as an embedded flow within the looping logic flow.

 

Flow 1: Contains the input screen(s).  You can create/manipulate records within this flow or assign the inputs to variables exposed as outputs for the flow

 

Flow 2: Embeds Flow 1, performs logic needed for looping, can also take the outputs from Flow 1 to create/manipulate records or make decisions.

 

When implemented this way, Flow 1 will reset its input fields to their default values each time that it runs within Flow 2.

All Answers

DarrellDDarrellD

Search this board a little and you'll see the same question asked. Unless someone has thrown in some kind of Apex Plug in to do this since I last checked, the answer is "No". Right now it retains all of the values previously entered. Even if you try to get creative and clear them yourself in a loop it doesn't work.

 

I'm hoping this is high up on the improvements board because it's a problem. Made worse by fact that you cannot "unselect" picklist values.

 

Darrell

RajaramRajaram
Yeah.. the standard implementation is to mimic the browser which shows the previous selection.
THis is something we have on the backlog already.
Jeff KranzJeff Kranz

I have successfully implemented a workaround for this by separating the input screens and the looping logic into separate flows, and using the input screens flow as an embedded flow within the looping logic flow.

 

Flow 1: Contains the input screen(s).  You can create/manipulate records within this flow or assign the inputs to variables exposed as outputs for the flow

 

Flow 2: Embeds Flow 1, performs logic needed for looping, can also take the outputs from Flow 1 to create/manipulate records or make decisions.

 

When implemented this way, Flow 1 will reset its input fields to their default values each time that it runs within Flow 2.

This was selected as the best answer
RajaramRajaram
oh Wow! Cool.. may be you can do a blog post it on the boards so that others may use this solution?
Thanks!
Jeff KranzJeff Kranz

Thanks!  Yeah, some sort of cloud flow "tips, tricks, and gotchas" blog post is definitely on my to-do list.  In the meantime, lets mark the solution as solved so that others can easily find it.

srichardsonsrichardson

This works very well. Excellent tip and thank you jakranz33

Mitch_AMSMitch_AMS
I too had this issue, what I did was create four(4) variables, that contained a null default value (1-text, 1-number, 1-boolen, 1-date). After the flow created the record, an assigment was used to change all of the stored variables back to a nul value before returning the user to beginning of the flow...  This worked for me... as far as I could tell...  Based on the comments above, perhaps I should double check, but I thought I tested it and it worked...