Hi Everyone,
We face an issue with pulling data from Mongo database everyday as we have to give a criteria everytime which is not in a date format and have to run a separate workflow everytime just to get those date filters in a format compatible with Mongo Input criteria.
I am attaching the steps we follow with respective screenshots for better understanding the problem. Would be great if someone could help out with a better way as we want to automate this task rather than running daily manually.
Regards,
Rushabh
Solved! Go to Solution.
You could extend the macro you have to create the criteria in Alteryx, then wrap the MongoDB Input in a macro that dynamically updates the criteria field.
1. Add a formula to build the criteria input from your values:
2. Wrap MongoDB Input up as a batch macro by adding a Control Parameter, and point the Action tool to update the 'Filter' field:
Looks good - now you just need to make a workflow that includes both macros:
Now when you run this, it will run the first macro to create the criteria, and then the second input will take that criteria and apply it to your MongoDB Input. However, since the macro doesn't do anything else, it will end there. You will either want to output the results of that second macro by adding a Macro Output tool, or build out the rest of your process within the second macro - it's up to you.
You can use a formula after the text input - here are some examples:
Yesterday's date:
DateTimeAdd(DateTimeToday(),-1,'days')
Today's date:
DateTimeToday()
Yup.. It struck me after posting that it was a stupid doubt.
But Thanks alot Sophia for all the help. It will help me save Time & efforts.
Regards,
Rushabh