10

I want to see the values of an SObject collection variable in the flow. Is there a way to see the values of a SObjectcollection variable? I want something like debug statement in apex.

1

I know this is an old thread but just in case people are stuck like i was and there seems to be something "new" that I missed. But the debug button next to run is pretty awesome!

enter image description here

| improve this answer | |
2

If you set the debug log for user running the flow for Workflow to be Finer, it will show your assignment actions and values.

Here are the log actions you can get: https://www.salesforce.com/us/developer/docs/apexcode/Content/code_setting_debug_log_levels.htm

| improve this answer | |
2

Perhaps the quickest way to see your sObject values is to add a Screen element where you display one or more fields. If you have a collection of records you'll need to loop through the collection, which means your screen will pop up each time, so if you have a large collection you'll want to try to filter it down for debugging purposes.

Another quick trick is to simply count the number of records in your collection to see if you're getting the number that you expect. Sometimes that can help you identify a problem before you inspect fields on each record.

'Hope this helps!

| improve this answer | |
0

Without more context, your question is difficult to answer. When you run your flow, you can enable debugging for the user and a log will be created. So in a controller, you could add debug statements that would appear in your log. You can also display the current value of any variables at any point for development even if they're not being used or needed. Later, you can hide or remove the code for those variables.

| improve this answer | |
  • This question was about flow. Your answer was only about code. There is no controller in Flow. There is no ability to add debug statements in Flow. – JodieM Feb 27 '19 at 10:11
  • @JodieM You may want to read up on your documentation about flows. Salesforce auto creates a controller for you when you create a flow which can also be edited. Flows have a controller that sets the finish point and a number of other parameters that flows use to run. – crmprogdev Feb 28 '19 at 11:30
  • Oh wow, thank you for that, I had no idea. Thanks to flow expert Jen Lee for helping me find the documentation on creating a Class for a Flow developer.salesforce.com/docs/atlas.en-us.pages.meta/pages/…. @crmprogdev I wonder if you can help us understand this more, by providing an example of how you would get to the variables from each part of the flow, or would you just reference each variable in the controller and put a statement as a debug against each variable? Thankfully now we have the Debug button that basically does all that. But this is good to know. – JodieM Mar 1 '19 at 4:10
  • @JodieM Much has changed with flows and flow builder since this question was asked nearly 4 years ago. Your question should be posted as a new question rather than as part of discussion in an answer to an existing question. I recommend it be specific enough to meet the guidelines of this forum. See How do I ask a good question. – crmprogdev Mar 2 '19 at 18:27

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.