Background:
This article will go through how to use Organization and User contexts in the connection strings of the data sources you can connect to in Wyn. The most common use case for this is for multi-tenant data.
Creating an organization context value:
Go to the organization panel on the admin portal and look for this item.
You will need to create organization contexts by selecting the add property button.
When in the creation you will be able to give it a dame, and 2 properties.
Required will make it so that the organization must have this context filed in their schema.
Multi valued will make it so that the context can have multiple values. (Not useful for this use case.)
After that you are able to go out and add values to the contexts. As well as determining if the sub organizations can edit and view the contexts of the main organizations values.
Creating User Contexts:
Navigate to the Custom Property section of the accounts area of the admin portal.
When on that tab you will see an Add Property button. On clicking you will go into the creation.
In this you will be able to give the property a Name, along with other permissions and value controls.
These can be edited in the main screen again by selecting the three dot more options area at the end of the bar.
After that you can edit it on a user by user basis on the admin portals user panel.
First option in picture is an item with available values and the second has multiple values enabled. The last 2 are the standard single string that can be entered in manually.
These values also are visible from the user page as well once entered.
Calling the Contexts:
To add an Organization context you will use #{context name}.
Below is an example of how this will work with the sample calling the db context. This is the most standard use case as this will switch between the tenants and give each of your tenants different data when they view anything made with this data source.
To use the user context you will do similar with the @{value} format. The most common use case for these would be if you monitor your database by who access it with using values for Username and Password areas of the connection string.