If you are an App Developer and want to know more about how to include this into your App or how to let your App support BLL coding, goto the[APP][Pro] Better Logic Library - For Developers Forum Topic.
The Better Logic App has a new addition: A library and library management for other apps to consume.
This Topic describes how users can use these functionalities.
BLL Coding
Within all flowcards that supports BLL coding, you can add any BLL expression within the next codeblock: {[ expression ]}.
You can use this f.i. within the Save Image Token flowcard from the FTP Client App
This image will be saved with the custom timestamp the user writes himself:
Here you can alter the definition of any default datetime formats for the default locale.
This will be applied to every app using the BLL coding or DateTime.
BLL codings are expressions within text-arguments in flowcards.
In every App that supports BLL coding, for each text-argument in flowcards that goes through the BLL decoder, you can use {[ expression ]} .
Within these expressions, you can use build-in modules, functions and your own customisable functions.
Modules
_
Lodash 4.17.21
math
Math.js 11.3.3
Example The last one is: {[ _.last(["1", "2"]) ]}.
Result:
The last one is: 2.
Build-in functions
date(format, date?, locale?, timeZone?)
This method will return the current date(time) in the entered format, with respect to the user defined locale (language) en timezone.
Optionally you can supply the date(time), locale and/or timeZone.
Example Today is a {[ date("dddd") ]}
Result:
Today is a donderdag
Within BLL coding or expressions you can use the number method to convert numbers into text, based on your (or another) locale/language.
It supports overloading, and can be used the following ways:
Is it possible to add the “GMT +1” part separately?
F.i. Homey locale is English,
but I want to use 24h time, without changing the BLL locale to Dutch.
No fixed GMT+ yet, that will only appear with KK or kk when you have a locale of EN f.i…
(So for you, this will show GMT±, for me it shows CET).
Fixed GMT+ will be Z, but no luck yet to complet this part without adding external node-modules.
And i don’t want that, they are all a few MB, while my custom solution is less then 20kb.
Thank you for continuing development of this great app!
I upgraded from the legacy Better Logic today and there seems to be an issue with Math.JS condition card. As POC I created T1 and T2 booleans and a test flow.
If Math.js expression is true. All variants of T1 and T2 being true of false is considered false.
If Math.js expression is false. All variants of T1 and T2 being true of false is considered true.
Not sure if this is the same issue and all mathjs calculations are effected, but my BL math.js calculations does not seems to work anymore since november 14. The calculation is quite simple, it is for calculating the costs of a dishwasher cycle