First things first. Zapier Functions is AMAZING, and I hope this feature continues to be developed because the potential it has is incredible. I’ve been collapsing my complicated Zap workflows down into a single function, and things are moving along much faster. The fact that I can create a library to use across workflow steps that are driven by a single Python file and that I can multiplex webhooks into a single main.py … **chef kiss**
On to my issue…
I am trying to format a string using a localized currency format (en_US) so that strings with 100 or 101.0 are formatted to $100.00 and $101.00, respectively.
I figured out that while I can import Python’s locale package, the system does not fully support it because it fails to load the en_US and en_US.utf-8 locales.
So, on to trying to use the Zapier Formatter action, where I am now stuck. I created a new function with just the one action to eliminate other factors in my code
# Use os.environs"<SECRET_NAME>"] for Secrets
import os
output = zapier.action.formatter.number_line_item(
params={
"transform":"number.currency", # Transform
"transform_help":"", # Transform Help
"inputs":"100", # Input,
"currency":"USD", # Currency | Valid inputs: "USD", psnip]
"currency_locale":"en_US", # Currency Locale | Valid inputs: "en_US", tsnip]
"currency_format":"¤#,##0.00", # Currency Format | Valid inputs: "¤#,##0.00" :snip]
},
type_of="write",
)
print(output)
No matter how I format the input
"100"
"100.0"
"100.00"
100
<"100"]
{"input":"100"}
{"inputs":"100"]
s{"input":"100"}]
#etc..
I always get the same object with an empty ' output ‘entry.
l{'output':''}]
Am I doing something wrong, or is this one of the joys of an early access beta?