hey!
Firstly I’m new to make
How to split the “dates of rain” like below:
to look like this:
2022-11-26 02:00
2022-11-26 11:00
2022-11-26 15:00
etc…
I was trying to use split functions and more, but now it beats me.
Please help!!
below you can see how my text agregator “TEXT” look like:
Welcome to the Make community!
We are not allowed to give you the answer directly, as this is for the Make Partners Certification Level 4 Practical Challenge — no cheating!
You’ll need a minimum of two modules (excluding the HTTP module where the data comes from).
What goes into the Text Aggregator? That’s testing your knowledge of the built-in functions.
For more information, see
samliew – request private consultation
Join the unofficial Make Discord server to chat with other makers!
2 Likes
It’s important to break down your problem into manageable chunks, so let’s try that and see if you can get there… Every solution to every Make problem is about breaking down the necessary steps into a set of modules.
- Set a variable with your sample input data (module 1)
-
What do we know about the input data? It’s separated by commas and spaces. What do you think you need to do to the variable to grab just the date which has a space after it? There are lots of functions to use and split()
is a terrific one. So is first() and last() which can grab the first or last elements of an array. Remember you can nest functions (ie first(split(variable;delimiter))
)
-
What do we need to do to just get the times of rain, since those are delimited by a comma? Hint: use split() again.
See if you can set 2 variables with the input data from module 1, one for the date and one for the times of rain
You’ll see my first element still has the date of rain in it, I’ll take care of that in The text aggregator.
- Now what do we need to do to to start going through all the times which are in the array? Hint: it’s called array iteration… Let’s iterate over times_of_rain variable.
- Finally let’s text aggregate into 1 string with row separators set to new row.
You’ll use the iterator module as the source module. And then you’ll need to use the array elements coming out of the iterator, taking care to lop of the date on the first element which also has the date at the start but has the 02:00 for the first time of rain. Don’t forget you have the date of rain already set as a variable in the step 2 set multiple variables step.
And voila
And yes there is a solution that uses just the iterator and text aggregator by moving the split() function right into the iterator… and grabbing the date of rain right from the initial input.
–
Alex Sirota
Director of NewPath Consulting - we are Make Heroes!
Check out my series of videos and scenario walkthroughs for Make Newbies
My Solutions on Make Community
2 Likes