Skip to main content

I have a button which performs a run Apex action (custom invocable method). The method runs successfully and returns a URL as an output parameter. I can access this parameter as {{$PreviousAction.result.url}}. I can display this result in a modal as the next action on my button.


However, when I try to use this as the target for a Go To URL, the page refreshes but does not redirect me. When I hard-code the URL (for debugging), it successfully redirects, so I don’t think it’s a security issue.


I can’t find any errors in the console or debug logs and am stymied as to why it won’t redirect to the URL from the parameter.


Any ideas?

For context, the apex method creates a Stripe Checkout session using Stripe’s API. It returns a unique URL for the session and I need to redirect the user there to enter their payment information. When it’s done, it will redirect the user back to the site.


My goal is to embed this in a Community/Experience, but I am running this as a regular user to eliminate variables in why it’s not working.




yoni:


{{$PreviousAction.result.url}}



Try three brackets


{{{$PreviousAction.result.url}}}


I tried with both double and triple


There may be a bug here - and I’ll try to explore that.


But you might be able to pass the previous action result URL into a UI Only field as part of the action sequence that runs Apex, and then merge the Field value into your button action.


Ever get this to work? As expected or a workaround?


I got it working with javascript window.location. I could not get it to work with the action framework.


Do you have an XML page I can tinker with? Love figuring out stuff.


Reply