I have a question on the custom function BF_SetAction_Path

MF Leong:
I have a question on the custom function BF_SetAction_Path. Instead of taking me to a form , I would like to open an url instead. Is this possible ? Thank you


Andrew Dam:
There are a few of ways to handle this, but here are just a couple:

One way would be to set an action to runs JS on the front end to handle the redirect.

BF_SetAction_Function ( "window.location.href = '<https://www.google.com/>'")

Another would be to copy the custom function BF_SetAction_Path and modify it slightly to set the url rather than the path.

Let([

       // handle $$actions not being set
       $$BF_Actions = If ($$BF_Actions = "" ; "[]" ; $$BF_Actions);

       actionObj = JSONSetElement ( "" ; 
               [ "action" ; "path" ; JSONString ];
               [ "options.url" ; "<https://www.google.com/>" ; JSONString ]);

       index = ValueCount ( JSONListKeys ( $$BF_Actions ; "" ) );
       actions = JSONSetElement ( $$BF_Actions ; "[" &amp; index &amp; "]" ; actionObj ; JSONObject )

];

actions

)

Both of these methods should suffice for your workflow.