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
LloydSilverLloydSilver 

Best way to modify existing record within a flow

I have a flow which gives the user the option to modify an existing record. I'm having difficulty figuring out the best way to do this.

 

What I'd like is to have the flow do the record lookup and then on a screen display fields from that record and allow the user to modify those fields. So I'd have a Screen element with the appropriate fields (textbox, currency, checkbox, dropdown, etc.). The current values would be displayed and the user could make changes to those values.

 

I can't figure out how to do this, or if it's even possible.

 

What I'm doing right now is using a Display Text field to simply display the current values to the user. And then I have all of the fields needed under that display text. But there's no way that I can figure out to display the existing values as the default in each of the (choice) fields. So they basically have to go through each of the fields and re-populate them which is way less than ideal and prone to mistakes. For example, the display text would show their mailing address, but then they'd have to re-enter that address in the mailing address field.

 

While the fields allow for a default, it seems like they have to be one of the choices. And it doesn't look like the choices themselves can have a variable as a default value.

 

Am I missing something or is there a better approach to what I'm doing?

 

Thanks.

PoopermanPooperman

Prepopulating can be done with any element that is not multi-select. For checkboxes, you set the value to what you loaded. For picklists you create a choice whose value AND name are equal to the variable you loaded into. For instance, if you wanted to have  a phone number that you saved to a variable called PN you'd have the saved value be {!PN} and the name field to also be {!PN} (I always copy paste from the saved value into the name since there's no help text for it). Finally, to make it the "default" just make that choice the top one on the list of choiced.

 

Again, for multi-select, there is no way I know of to prepopulate them other than some convoluded Javascript or something of the sort. Hope this helps!