Liquid add appendix to URL

I’m trying to append content to a Url button link based on an if statement. I’ve tested my URL appendix and that works but I think there is an error in my liquid call.

{% if formSubmissionData.Duration.value == "1 hour" %}

The field I want to check has the name Duration. I want to check the value of that field and if its “1 hour” change the URL.

its not currently working - I think its jumping straight to my else statement.

Your custom field in the form submission data would be accessed like this:

formSubmissionData.fields.custom.Duration.value

You are missing the fields.custom in the middle.
You can render this directly to the page to check you are getting the expected value, eg:

{{formSubmissionData.fields.custom.Duration.value}}

Thanks Adam - that worked perfectly !