2

I have a screen flow with two screens.

  • Screen 1 contains a form with a required field ("Credit Score") and two buttons: Cancel and Next:

enter image description here

I would like to give the user the option to exit the screen flow on screen 1 by clicking the Cancel button (clicking Cancel should end the flow and close the modal). Surprisingly, there doesn't seem to be any OOB support for this and I'm yet to learn Visualforce, so I resorted to looking for custom buttons on the App Exchange.

I went with the Flow Button Bar. The component allows you to associate a value to each button you add to the screen and returns the value of the button that was clicked. So, I added two buttons to Screen 1: 1) a Cancel button with value "Cancel" and 2) a Next button with value "Next":

enter image description here

In Button Bar Settings, I set Action Mode to "Navigation":

![enter image description here

I tried to capture the value of the clicked button by manually assigning its value to a text variable called bttn_group:

![enter image description here

Finally, I added a Decision element that checks the value of bttn_group and routes to End if bttn_group == Cancel:

![![enter image description here

The resulting flow looks like this:

enter image description here

Problem

Clicking Cancel doesn't work. Whatever event handler is on the button seems to be intercepted by the validation rule on the required input:

enter image description here

I'm not sure why this is, but it seems bttn_group might not capturing the value properly. I tested this by adding a visibility rule on the "Current liquidity" input that says to show the input only if bttn_group == Cancel:

enter image description here

But, as you can see in the gif above, when I click on the Cancel button in the debugger, the "Current liquidity" input doesn't appear. So, bttn_group is not being set to "Cancel" when I click the Cancel button. Maybe I haven't assigned the value properly?

Any help on this would be greatly appreciated, as I'm not sure where I'm going wrong and don't know what to try next.

6
  • Here's a link to the Flow Button Bar docs. Couldn't add it in my post because I need >10 rep points to post more than 8 links.
    – user135792
    Oct 23, 2022 at 23:39
  • Here, have ten rep. This question is well-written. Welcome to the community, I hope you enjoy your stay here and come back often.
    – sfdcfox
    Oct 24, 2022 at 0:03
  • Yay! Thank you @sfdcfox :) Would you know of a declarative workaround for this issue by any chance? I came across this answer to a similar question you had asked and I don't mind doing it programmatically, but not sure where to start.
    – user135792
    Oct 24, 2022 at 0:12
  • Admittedly, I'm not a flow expert, but let me try to build one real quick.
    – sfdcfox
    Oct 24, 2022 at 0:29
  • Thank you, I tried toggling the validation rule according to the value ofbttn_group (i.e. {!bttn_bar.value} == "Cancel" || NOT(ISBLANK({!Credit_Score})), but that doesn't work.
    – user135792
    Oct 24, 2022 at 3:20

2 Answers 2

0

Instead of using validation,use the conditional visibility of the required field, {!buttonselect.value} != cancel . This should hide the component before navigating onto the next action within your flow.

It's quite interesting how it works, I guess the flow button bar selects the values first upon click and then hides the input component based on conditional visibility, and then executes the flow navigate action to move to the next screen.

enter image description here

0

In Simple, Use in Decision element, the operator 'Contains'. i.e bttn_group 'Contains' Cancel.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .