Prompted variable for step execution

Hi,

I am trying to setup a DB deployment with the option to run ad-hoc SQL scripts, everything runs as expected but I’d like to be able to set it so a user is prompted whether to run the ad-hoc script step.

I have created a variable “post-script” and can set the run condition of the step to variable and use…

#{if Post-Script == “Y”}true#{/if}

expression. This seems to work OK, but I’d rather the variable be a checkbox rather than the user entering ‘Y’ or ‘N’ the problem is I can’t seem to find out how to do this once the variable control type is set to Checkbox.

Grateful for any help.

Thanks!

Hi Dan,

Thanks for getting in touch! You can actually use simply #{post-script} as the variable run condition on the step to control whether the step is run based on the checkbox being ticked or not. I think this will give you the exact behavior you’re after. :slight_smile:

Let me know how you go or if you have any further questions or concerns going forward!

Best regards,

Kenny

Hi Kenny,

Thanks very much, that works perfectly. I knew it must be something simple I was missing!

Cheers,
Dan

Quick follow up question if I may - is there a way to order these parameters on the deploy release page? I have a deployment where we have two sets of scripts, one to be run before the Redgate database deployment and one after.

adhoc

I thought they were in alphabetical order so added a number prefix but they are not in the preferred order.

Thanks!

Hi Dan,

Thanks for following up, and that’s great to hear that’s working for you. :slight_smile:

Unfortunately the current behavior is these prompted variables in the deploy release page don’t seem to have any predictable sorting, but we think that it should be sorted alphabetically like you were expecting it to. It should be a fairly simple fix in the UI code, so we expect it to be included in a patch release very soon. You can track the progress of this issue here.

This isn’t something we noticed previously, so we definitely appreciate you pointing out this behavior. Don’t hesitate to reach out if you have any further questions going forward!

Best regards,

Kenny

Hi Kenny,

Thanks for the update. Good to hear it should be an easy update, I’ll keep an eye on the issue.

Thanks,
Dan

1 Like

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.