Henchway
4 years agoContributor
Elegant way for String interpolation
Hello,
I’m wondering if there is any elegant way in the Snaplogic Expression Language to achieve String interpolation? E.g. similar to f-strings in Python?
f"This is a test string including a {variable}"
The method I’m using at the moment is string concatenation, e.g.:
"SELECT " + [lib.env.salesforceGPDeliveryNumberField,lib.env.salesforceGPOperationsNumberField,"Id"].toString() + " FROM Opportunity WHERE " + lib.env.salesforceOpportunityIdField + " = '" + _opportunityId + "'"
This becomes fairly tedious with longer queries and prone to overlooking the one or other space or quote.
Concat might be a bit better than that, but still is somewhat tedious in comparison to string interpolation.
Is there a feature that I’ve overlooked or is there just no user-friendly method available?
Best regards
Thomas