Variable script in a module field

Hi,

First, my apologies for the newbie question :slight_smile:
I’ve been searching for a long time but couldn’t find the answer (might have missed something).
Is it possible, in a module field, to include a simple script as such:
{{ var foo=replace(“bar”;“a”;“ee”);
foo; }}

Thanks :slight_smile:

Sure use the replace() function found in the string section of the purple header box. It even supports regular expressions if you want a more complex substitution.

4 Likes

Hi Alex,

Thanks for your answer.

Sorry if my question wasn’t clear. In my example, the replace function is indeed used, but it’s the use of variables that doesn’t seem to work.
Can I define a variable in a block code just for local use?

And similar question, is there a was to create a simple custom function in addition to the standard one, without having to access external services as described in other questions? (like google apps code, aws, etc.)

Thanks

You can use the set variable or set multiple variables module. There’s no native way to create code blocks in the system. Some are working on third party solutions but I tend to shy away from those until Make creates a standard way.

And again the answer is no unless you consider a scenario called by a webhook to be a custom function. Make is a no code tool and even though there are logical and functional constructs there’s no concept of a definable function like there is in other programming languages. Maybe one day.

Many hanks for your answers. That’s what I feared :frowning:

That’s sad, because it could be so much easier to call a function or put a little peace of code in module fields instead of building a factory to do all that.

Is there visibility somewhere on a kind of roadmap/what’s in the plans/if something will be done or not?

There is a wishlist of sorts available called the idea exchange. — you can vote and looks for ideas and app improvements or additions.

Your idea has 115 votes.

Thanks :slight_smile:
Much appreciated

This one relates indeed to my request:

Indeed. How I miss that one? @Darin_Patterson is the product lead and he definitely has a pulse on what’s coming to make. And that it’s marked as planned is a good sign.

2 Likes

Yep indeed :smiley:
thanks again