Fbizzzzle Posted March 28, 2020 Report Share Posted March 28, 2020 I am trying to dynamically set a Yes/No field in addition to redirecting a user after completion of a submission page. This is the code that I have in the Destination Page. Virtual1 captures the type and YesNoVariable is the flag that I want set. What I've done below does provide the right redirection based on the Virtual1 value but the value to set the YesNoVariable to true (or checked) does not. <script type="text/javascript"> if("[@cbParamVirtual1]" == "Adoption") { document.getElementById("InsertRecordYesNoVariable").checked=true; window.location = "http://page1?ProfileID=[@field:ProfileID]&ProfileFullName=[@field:ProfileFullName]"; } else if("[@cbParamVirtual1]" == "Foster") { window.location = "http://page2"; } else { window.location = "http://otherpage"; } </script> Appreciate fixing my code and any help in understanding how to properly set this value. Thanks in advance. Quote Link to comment Share on other sites More sharing options...
AtayBalunbalunan Posted March 29, 2020 Report Share Posted March 29, 2020 You may want to check Trigger for your workflow so you will not use custom code. You can set your Yes/No field to Yes depending on a value of a field in your table. You may want to add a new field in your table. This tech tip may also suit your workflow. Quote Link to comment Share on other sites More sharing options...
Fbizzzzle Posted March 29, 2020 Author Report Share Posted March 29, 2020 @AtayBalunbalunan thanks for the reply. I hadn't thought of the Triggered Action as an option but I do like it. I was so focused on just leveraging the datapage to help manage the flow and information that I overlooked it but you are right, I would have to add a new value to pass the option to the triggered action. Thanks. I did look up the tech tip which led me to a part of the flow that I didn't show where it does navigate to a specific page based on the option. Thing is, I still want to understand the right syntax to set Yes/No Boolean values in Javascript. I keep feeling it shouldn't be as hard as it is, but for me, it is. Quote Link to comment Share on other sites More sharing options...
Kurumi Posted September 13, 2021 Report Share Posted September 13, 2021 Hi - instead of JS, you may try using Calculated Value with CASE WHEN statement to set the criteria. After that, you can check this type of flow: https://howto.caspio.com/tech-tips-and-articles/common-customizations/dynamic-redirects-after-form-submission/ Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.