Skip to main content

Hello people,

First, I’m new to Zapier. Previously Make.com user, I’m trying the service and migrate all my functions to Zapier. So far, I was able to do everything I need, except one scenario.

I want to parse a RSS for all the available posts between 2 dates : 2010 and 2023 for example.

Then, I want to generate a random number to take the corresponding post in my RSS.

My final objective is to post on a social network, a random and old post from a RSS.

I could potentially publish a screenshot on how I did that on Make.com but maybe it’s restricted.

Someone could point me some directions because I don’t know how to do that with Zapier.

Thank you for any hint. 🤲

Hi @akril 

Good question.

You can use a Code step.

 

CONFIG

 

CODE

let Length = inputData.Length;
let Random = Math.floor(Math.random() * Length);

output = {Length, Random}];

 

OUTPUT


@akril 

Here’s another approach using the Formatter app.

 


Hello @Troy Tessalone 

Thank you for your help on this.

I’m sorry but I’m still very noob and you’re assuming some steps that I’m not mastering right now.

When I’m choosing “Code” in my function. Should I choose Python or Javascript ?

Looks like Python but it’s strange to have “;” at the end no?

I’ve tried the following and unfortunately it’s a no go. 😵💫

 

 

 


@akril 

JavaScript


My bad. It’s OK now :)

And by the way, your second method with Formatter app is much easier.

Thank you !


Glad to see Troy was able to help out here, @akril! 🎉

Please do return to the Community if you run into further questions. We're always happy to assist! 🙂