Overview
Variables, variables, variables. We have looked closely at how variables are being used in Fastgen, talked to many users about it and copied some additional standards from the programming world. The result is a complete overhaul of variables within Fastgen, including the ability to define types, smart operators that help you amend variables, the ability to manage multiple variables in one action block and more than 50 new functions to create and manipulate variables. Sounds like a lot? Agreed.
1. Define Variable types
You are now able to define types for Fastgen variables. You can choose between List, JSON, Boolean, Text, Number and Date. This will enable you to understand and work with data in a more organized and understandable way as well as lower the potential for mistakes when working with variables.
2. Amend variables with operators
In addition to simply saying x = y, we added the ability to assign them in more elaborate ways. Want to add an item to an array that is stored in a variable, you can do that. Want to add or subtract a number from a value and assign that to a variable, you can do that as well. Each data type has its own operators to help you change variables according to what you need.
3. Manage multiple variables in one action
No more using 3 variable blocks to define 3 different variables. You are able to manage multiple variables within one action, making your APIs and workflows more straightforward. It is also possible to assign and then manipulate a variable in the same block if you need to gather data from multiple sources and combine it in one variable.
4. 50 new functions to create and manipulate variables
You heard that right, 50 new functions that you can choose from to create and manipulate your variables. You can see an excerpt of the new functions below. You can find all of them in our docs here:
1. String Functions (e.g. trim, upper/lower, replace, hasPrefix, split)
2. Date functions (e.g. now, duration, date)
3. Number functions (e.g. min, max, abs)
4. Array functions (e.g. find, count, join, sum, sort, filter)
5. Type Conversions (e.g. toJson, fromJson, toBase64, fromBase64, toFloat, toString)
All in all, the enhanced variable combined with the new if/else logic action we launched yesterday are moving a lot of power right into the core actions and reduce the reliance on custom code or SQL to manipulate data. We hope you are as excited about it as we are.
Let us know what you think. And as always, happy building!