Entry & formatting of a date/text

I have a date (credit card expiration date) that I receive from an external API as:
“12/2024”

I need to return it as:
“2024/12/31”

What is the best way to:
A) Constrain entry to a user-friendly form (e.g. 12/24 or 12/2024. Ideally both would be allowed.)
B) How do I take that entry and reformat it into the return value form: “2024/12/31”?

I figured out (B) with a :split by.

For (A), I see that I can set a conditional with an :Extract by Regex.

How do enforce that? I don’t see any options that will prevent the form submit like the built-in This input should not be empty does.

I have a work-around for field validation enforcement…

  1. I created a fake API and pass these required fields to it.

This causes Bubble to detect a submit event coming and it enforces its own This input should not be empty.

  1. I also added a Terminate action to the Workflow with the Only when set to the same conditional as the one used with the regexp on the expiration date input.

So, all of my issues that started this post have been resolved…albeit hackishly.

Does anyone see any better solutions than these?

This topic was automatically closed after 70 days. New replies are no longer allowed.