Add a date picker

Hello, I need help adding a date picker so that a user can choose a date and then from that it changes a variable in a query parameter for an API request to load in data corresponding with the chosen date? would love any suggestions.

Thanks,
Luke

Are you working on mobile or web? On mobile, you can just use the Pick date flow function (available via the Marketplace). To pass the picked date to your API, you’d want to have a REST data resource configured (via the Data tab on the global toolbar) with an appropriate query parameter, and an All type data variable on your page.

Then, you should have a page variable to store the picked date, something like pickedDate.

Next, you’d connect the Pick date node to a Set page variable node, setting pickedDate to the picked date (use the Output of another node binding type).

Finally, you could tweak the data resource fetching logic by going to the Variables tab, selecting the data variable, opening its logic canvas and adding a Receive event node configured for the pickedDate changed event – so that whenever a new date is picked, the code immediately starts to fetch a new record with the updated query parameter.

Let me know if something is still unclear!

1 Like

@Harri_Sarsa thanks for the reply. So that all makes sense. I’m just having a little difficulty setting it up. Is there any way to share the project with you and get some assistance with this. I just need to get the picked date passed into the parameter.

I create a sample page that shows how to pick the date – see “Pick date example” under the Page section in Marketplace.

I’ll work on getting a sample page with a dynamic query param too!

@Harri_Sarsa Okay thank you. Appreciate the help