Using low-code references for message creation
When creating messages for various systems, such as HTTP payloads, you will likely need to include dynamic data, such as results from previous Process steps. To do this, you can use low-code references in your code, which begin with a hashtag (#). Frends Processes offers several low-code references that you can use:
#result: references the result of the previous step. Note that all steps don't return anything to reference.
#result[Task Name]: references the result of a previous Task, such as the response of an HTTP request.
#trigger: references the Trigger that activated the Process, providing metadata about its name and type.
#process: provides metadata about the current Process, including its name, version, and full URI.
#env: provides access to Environment Variables defined in the Environment Variables List View.
#var: provides access to any variables defined using either the Expression or C# Statement Element.
Before using these references, it's important to note the input field modes in Frends. Task fields can be in Text, SQL, JSON, XML, or Expression mode, which can be changed above the field.
In all modes except Expression, you must use the following syntax for low-code references: {{#var.example}} (note the double brackets). In Expression mode, the field converts to C# expression style, and you don't need the brackets. Simply #var.example is enough.
Here's an example of creating an email message for a customer in text mode. If the customer data is stored in a variable called "customer", the message would look like this:
Dear {{#var.customer.mainContact}}, This is a test message. Best regards, {{#env.EmailSettings.EmailSenderName}}
The next article is Introduction to Finalizing your Process
β