AddressService
The new generation of OneOffixx address providers performs the search on the OneOffixx server and no longer on the client.
Configuration
All new address providers, are enclosed in a provider that serves as an interface between the new and old worlds. Example:
<!-- AddressService -->
<AddressProvider id="E10A8313-A92D-4CB2-A12B-9AEB58F39207" order="1" active="true" ServiceUrl="http://localhost:41380/api/v1/Address">
<!-- Insert configuration of server-side address providers here -->
</AddressProvider>
Parameters
- id GUID that identifies the AddressService. Always
E10A8313-A92D-4CB2-A12B-9AEB58F39207
- order Specifies sorting with other address providers in the recipient dialog.
- active Indicates if the address provider is available.
- ServiceUrl Optional. Configured in rare cases if the AddressService running in parallel from the service endpoint for synchronization should not be used.
Example:
<!-- AddressService -->
<AddressProvider id="E10A8313-A92D-4CB2-A12B-9AEB58F39207" order="1" active="true">
<!-- serverside Excel/CSV address provider -->
<AddressProvider id="62C19ADA-826B-4EBC-848D-B32E957D78C6" Title="myCSVFile.csv">
<SearchParameters>
<SearchParameter Name="firstName" Label="Vorname/Name" Type="String" Length="100" Sort="1" />
</SearchParameters>
<FilePath>myCSVFile.csv</FilePath>
<Provider Name="CSV"></Provider>
<Icon></Icon>
<Mapping>
<!-- Mapping -->
</Mapping>
</AddressProvider>
</AddressProvider>
Note
The AddressService will not work without a configured security key. This must be generated in the dashboard beforehand.
Address providers
Excel/CSV
Configuration:
<!-- AddressService -->
<AddressProvider id="E10A8313-A92D-4CB2-A12B-9AEB58F39207" order="1" active="true">
<!-- serverside Excel/CSV address provider -->
<AddressProvider id="62C19ADA-826B-4EBC-848D-B32E957D78C6" Title="myCSVFile.csv">
<SearchParameters>
<SearchParameter Name="firstName" Label="Vorname/Name" Type="String" Length="100" Sort="1" />
</SearchParameters>
<FilePath>myCSVFile.csv</FilePath>
<Provider Name="CSV"></Provider>
<Icon></Icon>
<Mapping>
<!-- Insert mapping here -->
</Mapping>
</AddressProvider>
</AddressProvider>
Parameters:
- id 62C19ADA-826B-4EBC-848D-B32E957D78C6
- SearchParameter List of all possible inputs.
- Name Unique id for the parameter. Corresponds to the column headers for CSV or for Excel files in which to search.
- Label Displayed text in front of the input field. Type Input type: String (text), Long (number), Boolean (Yes/No) or Date. Length Maximum length for strings
- Sort Sort value against the other parameters
- Mapping Mapping to OneOffixx contact fields. See default contact mapping.
- Provider Provider, either CSV or EXCEL. Specified in the Name attribute.
- Title The title that will be displayed to the user.
- Icon Base64 icon that will be displayed to the user in the recipient dialog.
File: CSV Provider
Configuration:
<Provider Name="CSV">
<HasHeaders>True</HasHeaders>
<Delimeter>,</Delimeter>
</Provider>
- HasHeaders Default value:
True
if the CSV file has headers. OtherwiseFalse
. If there are no headers, the columns will be numbered (adjust SearchParameters and mapping accordingly). - Delimeter Separator. Default value:
";"
.
File: Excel Provider
Configuration:
<Provider Name="EXCEL">
<HasHeaders>True</HasHeaders>
<Sheet>Sheet 2</Sheet>
</Provider>
- HasHeaders Default value:
True
, if the Excel file has headers. OtherwiseFalse
. If there are no headers, the columns will be numbered as in Excel (A, B...) (adjust SearchParameter and Mapping accordingly). - Sheet The Excel sheet to use. If no value is specified, the first sheet will be used.
Generic SQL
Configuration:
<!-- AddressService -->
<AddressProvider id="E10A8313-A92D-4CB2-A12B-9AEB58F39207" order="1" active="true">
<!-- serverside generic SQL address provider -->
<AddressProvider id="7E50AA46-A035-4F11-B44F-BBCBAB4780B7" Title="My DB Soure">
<SearchParameters>
<SearchParameter Name="firstName" Label="Vorname/Name" Type="String" Length="100" Sort="1" />
</SearchParameters>
<ConnectionString>{ConnectionString}</ConnectionString>
<ConnectionProvider>System.Data.SqlClient</ConnectionProvider>
<Query>
SELECT * FROM Users WHERE FirstName Like '%' + @firstName + '%'
</Query>
<Mapping>
<Map Source="CompanyName" Target="Company_Name" />
<Map Source="Title" Target="Person_Title" />
<Map Source="FirstName" Target="Person_FirstName" />
<Map Source="LastName" Target="Person_LastName" />
<Map Source="Birthday" Target="Person_BirthDate" />
<Map Source="Street" Target="Company_Street" />
<Map Source="Zip" Target="Company_ZipCode" />
<Map Source="City" Target="Company_City" />
<Map Source="FaxBusinessDirect" Target="FaxDirect" />
<Map Source="EmailBusinessDirect" Target="EmailDirect" />
<Map Target="Company_CountryShortCode">
<Map.SourceExpression>
function main()
{
switch(source('Country'))
{
case 'Albanien': return 'AL';
case 'Andorra': return 'AD';
case 'Aserbaidschan': return 'AZ';
case 'Belgien': return 'BE';
case 'Bosnien und Herzegowina': return 'BA';
case 'Bulgarien': return 'BG';
case 'Dänemark': return 'DK';
case 'Deutschland': return 'DE';
case 'Estland': return 'EE';
case 'Finnland': return 'FI';
case 'Frankreich': return 'FR';
case 'Georgien': return 'GE';
case 'Griechenland': return 'GR';
case 'Irland': return 'IE';
case 'Island': return 'IS';
case 'Italien': return 'IT';
case 'Kasachstan': return 'KZ';
case 'Kosovo': return 'XK';
case 'Kroatien': return 'HR';
case 'Lettland': return 'LV';
case 'Liechtenstein': return 'LI';
case 'Litauen': return 'LT';
case 'Luxemburg': return 'LU';
case 'Malta': return 'MT';
case 'Mazedonien': return 'MK';
case 'Republik Moldau': return 'MD';
case 'Monaco': return 'MC';
case 'Montenegro': return 'ME';
case 'Niederlande': return 'NL';
case 'Norwegen': return 'NO';
case 'Österreich': return 'AT';
case 'Polen': return 'PL';
case 'Portugal': return 'PT';
case 'Rumänien': return 'RO';
case 'Russland': return 'RU';
case 'San Marino': return 'SM';
case 'Schweden': return 'SE';
case 'Schweiz': return 'CH';
case 'Serbien': return 'RS';
case 'Slowakei': return 'SK';
case 'Slowenien': return 'SV';
case 'Spanien': return 'ES';
case 'Tschechien': return 'CZ';
case 'Türkei': return 'TR';
case 'Ukraine': return 'UA';
case 'Ungarn': return 'HU';
case 'Vatikanstadt': return 'VA';
case 'Vereinigtes Königreich': return 'GB';
case 'Weißrussland': return 'BY';
default: return 'CH';
}
return '';
}
</Map.SourceExpression>
</Map>
</Mapping>
</AddressProvider>
</AddressProvider>
Parameters:
- id 7E50AA46-A035-4F11-B44F-BBCBAB4780B7
- SearchParameter List with all possible entries.
- *Name__ Unique id for the parameter. Corresponds to the named parameter for the sql query.
- Label Displayed text in front of the input field Type Input type: String (Text), Long (Number), Boolean (Yes/No) or Date (Date) Length Maximum length for strings
- Sort Sort value against the other parameters
- Mapping Mapping to OneOffixx contact fields, see Mapping
- ConnectionString ConnectionString. May be encoded.
- ConnectionProvider System.Data.Odbc, System.Data.SqlClient, MySql.Data.MySqlClient, Oracle.ManagedDataAccess.Client.
- Title The title that will be displayed to the user.
- Icon Base64 icon that will be displayed to the user in the recipient dialog.
Query:
The SQL query must be in the format for the respective target database. Since all search parameters are treated as SQL parameters, the respective SQL parameter syntax of the target system must be followed.
Example: MS SQL
SELECT FirstName, LastName FROM Users
WHERE FirstName LIKE '%' + @firstName + '%' AND LastName LIKE '%' + @lastName + '%'
Example: MySQL
SELECT FirstName, LastName FROM Users
WHERE FirstName LIKE Concat('%', @firstName, '%') AND LastName LIKE Concat('%', @lastName, '%')
Warning
For Oracle, Odbc and PostgreSQL the order of the placeholders in the query must match the order of the "SearchParameters"!
Example: Oracle
SELECT FirstName, LastName from Users
WHERE UPPER(NVL(FirstName, ' ')) Like UPPER('%' || :firstName || '%') AND UPPER(NVL(LastName, ' ')) Like UPPER('%' || :lastName || '%')
Example: Odbc
SELECT FirstName, LastName FROM Users
WHERE FirstName LIKE '%' + ? + '%' AND LastName LIKE '%' + ? + '%'
Example: PostgreSQL
SELECT FirstName, LastName FROM Users
WHERE UPPER(FirstName) LIKE UPPER('%' || ? || '%') AND UPPER(LastName) LIKE UPPER('%' || ? || '%')
Warning
The restriction of the sequence has the consequence that a parameter can be used exactly once in the query.
The following MS SQL query cannot be translated directly to Oracle or Odbc:
SELECT FirstName, MiddleName, LastName FROM Users
WHERE FirstName LIKE '%' + firstName + '%' OR MiddleName LIKE '%' + firstName + '%'
If a parameter needs to be compared on more than one column, then these columns can be combined in the SELECT using the respective function of the database system:
Example: Odbc
SELECT STRING(FirstName, ' ', MiddleName) AS CompleteName, LastName FROM Users
WHERE CompleteName LIKE '%' + ? + '%'
Zefix
Warning
The SOAP/XML Zefix interface has been deactivated. To continue to receive address data, it is necessary to switch to the new address provider (see "Zefix (HTTP)"). The basic configuration is identical, adjustments to the Id
and possibly to the Mapping
must be made.
Configuration:
<!-- AddressService -->
<AddressProvider id="E10A8313-A92D-4CB2-A12B-9AEB58F39207" order="1" active="true">
<!-- serverside Zefix address provider (HTTP) -->
<AddressProvider id="DC124CDC-C2C0-4379-B9D4-079905E68DEA">
<!-- User/password for Zefix web service-->
<ServiceUser>info@oneoffixx.com</ServiceUser>
<ServicePassword>{password}</ServicePassword>
<!-- Optional Mapping -->
<Mapping>
<Map Source="name" Target="Company_Name" />
<Map Source="translation" Target="Company_Supplement" />
<Map SourceExpression="oo('address.street') + ' ' + oo('address.houseNumber')" Target="Company_Street" />
<Map Source="address.city" Target="Company_City" />
<Map SourceValue="CH" Target="Company_CountryShortCode" />
<Map Source="address.swissZipCode" Target="Company_ZipCode" />
<Map SourceValue="CompanyData" Target="AddressType" />
<Map SourceValue="false" Target="SalutationView" />
</Mapping>
</AddressProvider>
</AddressProvider>
Parameters:
- id DC124CDC-C2C0-4379-B9D4-079905E68DEA
- ServiceUser The user with which the provider logs into the Zefix service.
- ServicePassword The password with which the provider logs into the Zefix service: may be encrypted.
- Mapping: optional mapping to customize the filled information, see default contact mapping. Mapped from object
CompanyFull
. Available properties can be found at https://www.zefix.admin.ch/ZefixPublicREST/swagger-ui/index.html.
Above is an example of mapping the most common parameters. Note that you must map all the desired parameters.
ETV Access
Configuration:
<!-- AddressService -->
<AddressProvider id="E10A8313-A92D-4CB2-A12B-9AEB58F39207" order="1" active="true">
<!-- serverside ETV Access address provider -->
<AddressProvider id="BD633F5C-816A-4B7C-9546-EEDE889B8BDA">
<!-- User for ETV Access web service-->
<ServiceUser>{username}</ServiceUser>
<ServicePassword>{password}</ServicePassword>
<ServiceId>{serviceId}</ServiceId>
<MaxResultCount>50</MaxResultCount>
<EnableProxyCredentials>true</EnableProxyCredentials>
<!-- Optional Mapping -->
<Mapping>
<Map Source="FirstName" Target="Person_FirstName" />
<Map Source="LastName" Target="Person_LastName" />
<Map SourceExpression="source('StreetName') + ' ' + source('HouseNo')" Target="Person_Street" />
<Map Source="Apartment" Target="Person_Apartment" />
<Map Source="Floor" Target="Person_Floor" />
<Map Source="PoBox" Target="Person_PostOfficeBox" />
<Map Source="Zip" Target="Person_ZipCode" />
<Map Source="LocaPostName" Target="Person_City" />
</Mapping>
</AddressProvider>
</AddressProvider>
Parameters:
- id BD633F5C-816A-4B7C-9546-EEDE889B8BDA
- ServiceUser The user with which the provider logs in to the ETV Access service.
- ServicePassword The password with which the provider logs into the ETV Access service: may be encrypted.
- ServiceId The service id that the provider uses when accessing ETV Access.
- SecurityUri Optional service url to the authentication endpoint. Default: https://secure360.directoriesdata.ch/administration/v5/security.asmx?wsdl
- SearchAddressUri Optional service url to the address search endpoint. Default: http://service360.directoriesdata.ch/search/v5/searchaddress.asmx?wsdl
- Mapping: Optinal mapping to customize the filled information. Mapped from the 'EntryAdd' object. Available properties can be found in the XSD available at http://service360.directoriesdata.ch/search/v5/output/AddressData.xsd. "Subordinate" properties can be accessed via dot (
.
).
The example above shows a mapping of the most common parameters of a private contact. Note that you must map all the desired parameters.
innosolvcity (formerly NEST)
innosolvcity address provider by Innosolv.
This address interface addresses the "FindSubjectContactPerson" endpoint from the "BasisService".
Configuration:
<!-- AddressService -->
<AddressProvider id="E10A8313-A92D-4CB2-A12B-9AEB58F39207" order="1" active="true">
<!-- serverside innosolvcity address provider -->
<AddressProvider id="28F86C73-3A64-4BFF-AD87-CBDA92ED9170">
<NestVersion>2020</NestVersion>
<Uri>http://services.example.com:12345/BasisService</Uri>
<UserName>myUserName</UserName>
<Password>myPassword</Password>
</AddressProvider>
</AddressProvider>
Parameters:
- id 28F86C73-3A64-4BFF-AD87-CBDA92ED9170
- Title Title of the address provider. Default: "innosolvcity Kontaktperson" (for UI language German).
- NestVersion Version of the innosolvcity service.
2020
, if the innosolvcity release 2020 (or newer) is installed. - Uri Uri of the innosolvcity service endpoint (may be encrypted).
- UserName The user with which the provider logs into innosolvcity (may be encrypted).
- Password The password with which the provider logs into innosolvcity (may be encrypted).
- Debug
true
if additional information should be logged (request and response) - AllAddressTypeDefault
false
if the "AllAddressType" search parameter should be disabled. By using the "AllAddressTypes" search parameter (if configured), the user can change this option for the current search. - ActiveOnlyDefault
true
if the "ActiveOnly" search parameter should be active. The "ActiveOnly" search parameter (if configured) allows the user to change this option for the current search. - SearchParameters Here the search mask can be configured (see sample configuration). If this element is not configured, a default search mask is displayed (available in DE, EN, FR, IT; checkbox "AllAddressTypes" is not displayed). The following parameters can be used in the innosolvcity search:
- First name
- Last Name
- Date of birth (Date)
- StreetHouse
- Postal code (from NEST 2018)
- Place name (from NEST 2018)
- ID_Subject (Long)
- AllAddressTypes (Boolean) (from NEST 2018)
- ActiveOnly (Boolean) (from innosolvcity 2020)
- Mapping Optional contact mapping, see default contact mapping. Possible
source
fields which are retrieved by innosolvcity and made available for mapping:- AddressType
- AddressAddition
- ActiveInactive (from innosolvcity 2020)
- ActiveInactive_Cd (from innosolvcity 2020)
- Salutation
- DisplayName
- Letter salutation
- Letter address
- Company Name
- Date of birth
- ID_Subject
- ID_Subject_assignment (from innosolvcity 2020)
- Mobile
- Name
- Nation
- City
- POSTCODE
- PostcodeCity
- PostcodeAdditional digit
- StreetHouse
- StreetAddition
- SubjectType_Cd (from innosolvcity 2020)
- Telefax
- Telephone
- Title
- first name
- Additional name
Search parameters with translated labels:
[...]
<Title>innosolvcity Kontaktperson</Title>
[...]
<SearchParameters>
<SearchParameter Name="Vorname" Label="{U[Recipients.NestAddressProvider.SearchParameterLabel.FirstName]}" Type="String" Length="100" Sort="1" />
<SearchParameter Name="Name" Label="{U[Recipients.NestAddressProvider.SearchParameterLabel.LastName]}" Type="String" Length="100" Sort="2" />
<SearchParameter Name="Geburtsdatum" Label="{U[Recipients.NestAddressProvider.SearchParameterLabel.Birthday]}" Type="Date" Length="100" Sort="3" />
<SearchParameter Name="StrasseHaus" Label="{U[Recipients.NestAddressProvider.SearchParameterLabel.StreetHouse]}" Type="String" Length="100" Sort="4" />
<SearchParameter Name="PLZ" Label="{U[Recipients.NestAddressProvider.SearchParameterLabel.ZipCodeCity]}" Type="String" Length="6" Sort="5" />
<SearchParameter Name="Ortsname" Label="" Type="String" Length="100" Width="130" Sort="5" />
<SearchParameter Name="ID_Subjekt" Label="{U[Recipients.NestAddressProvider.SearchParameterLabel.SubjectID]}" Type="Long" Length="100" Sort="6" />
<SearchParameter Name="AlleAdressarten" Label="{U[Recipients.NestAddressProvider.SearchParameterLabel.AllAddressTypes]}" Type="Boolean" Length="100" Sort="7" />
<SearchParameter Name="ActiveOnly" Label="{U[Recipients.NestAddressProvider.SearchParameterLabel.ActiveOnly]}" Type="Boolean" Length="100" Sort="8" />
</SearchParameters>
[...]
Microsoft Exchange
This address provider allows to access contacts in Microsoft Exchange via the EWS interface. For this a "Service Account" from your Active Directory is required.
Configuration:
To access Exchange Online, authentication via OAuth is required. For this, an "App Registration" in Azure Active Directory is required. Follow these steps:
Log in via the Azure Portal.
Select your Azure Active Directory & copy the
TenantId
.In "App registrations" create a new one with any name you want.
In the "App" under "Authentication" enable the "Treat application as a public client" option.
Also in "Authentication" add
urn:ietf:wg:oauth:2.0:oob
as a "Redirect URI"Under "Manifest" insert the following entry under
requiredResourceAccess
within der square brackets:{ "resourceAppId": "00000002-0000-0ff1-ce00-000000000000", "resourceAccess": [ { "id": "3b5f3d61-589b-4a3c-a359-5dd4b5ee5bd5", "type": "Scope" } ] }
In "Overview" copy the
ClientId
.
You can also read this configuration in the Microsoft Documentation.
After completing the registration, store the ClientId
as AppClientId
and the TenantId
as TenantId
.
<!-- AddressService -->
<AddressProvider id="E10A8313-A92D-4CB2-A12B-9AEB58F39207" order="1" active="true">
<!-- serverside Microsoft Exchange address provider -->
<AddressProvider id="24425bd4-d6f1-4e2c-a323-3cc63fb5f07b">
<Debug>false</Debug>
<Title>Exchange Online</Title>
<EWSUrl>https://outlook.office365.com/EWS/Exchange.asmx</EWSUrl>
<AppClientId>{AppClientId}</AppClientId>
<TenantId>{TenantId}</TenantId>
<UserName>{username}</UserName>
<Password>{password}</Password>
<!-- Optional Mapping -->
<Mapping>
</Mapping>
</AddressProvider>
</AddressProvider>
Parameters:
id 24425bd4-d6f1-4e2c-a323-3cc63fb5f07b.
Title Title of the address provider. Default: "Exchange"
EWSUrl Uri of the Exchange service endpoint. For Exchange Online this is always "https://outlook.office365.com/EWS/Exchange.asmx""
UserName The user with which the provider logs on to Exchange.
Password The password with which the provider logs on to Exchange (can be encrypted).
AppClientId The AppClient id of the EWS app configured in AAD (Exchange Online only)
TenantId The TenantId of the AAD (Exchange Online only)
Debug
true
if additional information should be logged. Logged are the existing values which can be used for mapping.IgnoreSslErrors Ignore invalid SSL certificates or not. Default:
false
. Only partially necessary for OnPrem option.Mapping Optional mapping to customize the filled information.
The following data can be accessed via the default contact mapping:- DisplayName
- GivenName
- Initials
- CompanyName
- EmailAddresses
- Dictionary of type EmailAddressDictionary und Enum EmailAddressKey as Key
- PhysicalAddresses
- Dictionary of type PhysicalAddressDictionary und Enum PhysicalAddressKey as Key
- PhoneNumbers
- Dictionary of type PhoneNumberDictionary und Enum PhoneNumberKey as Key
- ContactSource
- Department
- JobTitle
- Manager
- Surname
- Alias
Certain values from the
dictionaries
are already extracted for the mapping and offered as simple values:- PhysicalAddressDictionary[PhysicalAddressKey.Business]
- City → Contact.Address.City
- Street → Contact.Address.Street
- PostalCode → Contact.Address.PostalCode
- State → Contact.Addess.State
- CountryOrRegion → Contact.Address.CountryOrRegion
- PhoneNumberDictionary
- PhoneNumberKey.BusinessPhone → Contact.Phone.Business
- PhoneNumberKey.CompanyMainPhone → Contact.Phone.CompanyMainPhone
- PhoneNumberKey.Mobile → Contact.Phone.Mobile
- PhoneNumberKey.BusinessFax → Contact.Fax.Business
- MailBox
- MailBox.Address → MailBox.Address
- MailBox.Name → MailBox.Name
Default Mapping The default mapping which takes effect if no mapping is defined includes the following properties (field names from Exchange):
- GivenName
- Surname
- JobTitle
- Profession
- MiddleName
- CompanyName
- Department
- BusinessPhone
- CompanyMainPhone
- BusinessFax
- MobilePhone
- PhysicalAddress.Business
- City
- PostalCode
- Street
- Mailbox.Address (Primary Email)
Note
EWS provides only the country name for an address, but not the ISO code of the country. In the OneOffixx recipient dialog, however, the two-letter ISO code must be set. For the default mapping this means that the country is not mapped via the address provider, but using the DefaultCountryCode
from the general recipient configuration.
If it is necessary to set the country specifically, because addresses from different countries exist within the (A)AD, then this must be done the same way as for the Generic SQL address provider.
SAP C4C (Cloud for Customer)
With the SAP C4C address provider you can access your contact data in the SAP Cloud for Customer. This requires a "Service Account" in the corresponding SAP C4C Cloud.
Configuration:
<!-- AddressService -->
<AddressProvider id="E10A8313-A92D-4CB2-A12B-9AEB58F39207" order="1" active="true">
<!-- serverside SAP C4C address provider -->
<AddressProvider id="91d36523-bae9-424e-9618-fae6162d20f7" Title="SAP C4C">
<EndpointUrl>https://{SAPC4CUrl}/{ApiBasepath}/v{APIVersion}/{APIEndpoint}</EndpointUrl>
<UserName>{Username}</UserName>
<Password>{Password}</Password>
<SearchParameters>
<SearchParameter Name="firstName" Label="Vorname/Name" Type="String" Length="100" Sort="1" />
</SearchParameters>
<Query><![CDATA[$filter=FirstName eq '{firstName}']]></Query>
<!-- Mandatory mapping -->
<Mapping>
</Mapping>
<Icon></Icon>
</AddressProvider>
</AddressProvider>
Note
This configuration is only the basic configuration and cannot be used alone. Since any endpoint of the SAP C4C service can be connected via this address provider, a lot of different configurations exist. After the parameters, three example configurations are listed for the three most important endpoints in relation to address data.
Parameters:
- id 91d36523-bae9-424e-9618-fae6162d20f7
- Title Title of the address provider. Default: "SAP C4C"
- EndpointUrl Url of the SAP C4C service endpoint.
- UserName The user with which the provider logs on to the SAP C4C service.
- Password The password with which the provider logs on to the SAP C4C service (can be encrypted).
- SearchParameter List with all possible entries.
- *Name__ Unique id for the parameter. Corresponds to the placeholder in the Odata Query. Label Displayed text in front of the input field Type Input type: String (text), Long (number), Boolean (Yes/No) or Date (date) Length Maximum length for strings
- Sort Sort value against the other parameters
- Query The query for the request at the service is written using OData v2. The search parameters can be referenced using
{SearchParamId}
within the query. At this point, further documentation of the query is omitted, as three examples of configuration are shown below. - Mapping The mapping to be defined is a default contact mapping, which must contain the name of the property of the corresponding entity as
SourceAttribute
. The mapping must be configured. There is no default mapping that takes effect if one has not been explicitly defined. - Icon Base64 icon that is displayed to the user in the recipient dialog.
The ODataQuery
can also be used to load dependent entities. It must be noted that dependent entities are always returned as an array by the service. This means that for the SourceAttribute
the index of the array must also be specified: RelatedEntityCollection[0].RelatedEntityPropertyName
.
Note
Via the url https://{SAPC4CUrl}/sap/c4c/odata/v1/c4codataapi/$metadata all entities contained in the service can be viewed with their properties and navigation properties. This is especially helpful for the query as well as the mapping.
Examples
The examples refer to the entities of the Api V2.
<!-- AddressService -->
<AddressProvider id="E10A8313-A92D-4CB2-A12B-9AEB58F39207" order="0" active="true">
<!-- serverside SAP C4C address provider -->
<AddressProvider id="91d36523-bae9-424e-9618-fae6162d20f7" Title="SAP C4C – Kunden">
<EndpointUrl>https://{SAPC4CUrl}/sap/c4c/odata/v1/customer/CorporateAccountCollection</EndpointUrl>
<UserName>{Username}</UserName>
<Password>{Password}</Password>
<SearchParameters>
<SearchParameter Name="company" Label="Firma" Type="String" Length="100" Sort="1" />
<SearchParameter Name="street" Label="Strasse" Type="String" Length="100" Sort="3" />
<SearchParameter Name="plz" Label="PLZ/Ort" Type="String" Length="6" Sort="4" />
<SearchParameter Name="city" Label="" Type="String" Length="100" Width="130" Sort="4" />
<SearchParameter Name="country" Label="Land" Type="String" Length="100" Sort="5" />
</SearchParameters>
<Query><![CDATA[$filter=substringof('{company}', Name) and substringof('{street}', Street) and substringof('{city}', City) and substringof('{plz}', StreetPostalCode) and substringof('{country}', CountryCodeText)]]></Query>
<Mapping>
<Map Source="Name" Target="Company_Name"/>
<Map Source="CountryCode" Target="Company_CountryShortCode" />
<Map Source="City" Target="Company_City"></Map>
<Map Source="StreetPostalCode" Target="Company_ZipCode"></Map>
<Map SourceExpression="source('Street') + source('HouseNumber')" Target="Company_Street"></Map>
<Map Source="Phone" Target="Company_PhoneCentral"></Map>
<Map Source="Floor" Target="Company_Floor"></Map>
<Map Source="Email" Target="Company_EmailCentral"></Map>
<Map Source="WebSite" Target="Company_Homepage"></Map>
<Map Source="Fax" Target="Company_FaxCentral"></Map>
<Map Source="POBox" Target ="Company_PostOfficeBox" ></Map>
<Map Source="POBoxPostalCode" Target="Company_PostOfficeBoxCity_ZipCode"></Map>
<Map Source="POBoxDeviatingCity" Target="Company_PostOfficeBoxCity"></Map>
<Map Source="CareOfName" Target="Company_CareOf"></Map>
<Map SourceValue="CompanyData" Target="AddressType"></Map>
</Mapping>
</AddressProvider>
</AddressProvider>
SharePoint Online
With the SharePoint Online address provider you can access your SharePoint lists.
Configuration:
To access SharePoint Online, authentication via OAuth is required. This requires an "App Registration" in Azure Active Directory. Perform the following steps:
- Log in via the Azure Portal.
- Select your Azure Active Directory & copy the
TenantId
. - In "App registrations" create a new app with any name you like.
- In "API permissions" add the
Microsoft Graph Sites.Read.All
permission (requires Admin Consent). - In "Certificates & secrets" add a new client secret.
<!-- AddressService -->
<AddressProvider id="E10A8313-A92D-4CB2-A12B-9AEB58F39207" order="1" active="true">
<!-- serverside SharePoint Online address provider -->
<AddressProvider id="5da866b2-e63a-11eb-ba80-0242ac130004" Title="SharePoint">
<HostUrl>{HostUrl}</HostUrl>
<TenantId>{TenantId}</TenantId>
<ClientId>{ClientId}</ClientId>
<ClientSecret>{ClientSecret}</ClientSecret>
<Site>{SiteName}</Site>
<List>{ListName}</List>
<SearchParameters>
<SearchParameter Name="firstName" Label="Vorname/Name" Type="String" Length="100" Sort="1" />
<SearchParameter Name="street" Label="Strasse" Type="String" Length="100" Sort="2" />
</SearchParameters>
<Query>
<Filters>
<Filter>substringof('{street}', fields/Street)</Filter>
<Filter>substringof('{firstName}', fields/Vorname)</Filter>
</Filters>
<OrderBy>fields/Vorname</OrderBy>
<Top>30</Top>
<Expand>fields(expand=LinkedPerson)</Expand>
<Select>fields/Vorname, Fields/Name, fields/SpaltenName</Select>
</Query>
<Debug>true</Debug>
<Mapping>
<Map Source="Name" Target="Person_LastName"></Map>
<Map Source="Vorname" Target="Person_FirstName"></Map>
<Map Source="Adresse.address.street" Target="Person_Street" />
<Map Source="Adresse.address.city" Target="Person_City"></Map>
<Map Source="Adresse.address.postalCode" Target="Person_ZipCode"></Map>
</Mapping>
</AddressProvider>
</AddressProvider>
Parameter:
- id 5da866b2-e63a-11eb-ba80-0242ac130004*.
- Title Title of the address provider. Default: "SharePoint"
- HostUrl Host-Url of SharePoint Online (without https://) e.g.
company.sharepoint.com
. - TenantId The TenantId of the AAD
- ClientId The AppClient ID of the App configured in the AAD
- ClientSecret Client Secret of the APP configured in the AAD (can be encrypted).
- Site Name of the site in which the list is created.
- List Name of the list
- SearchParameter List with all input options
- Name Unique id for the parameter. Corresponds to the placeholder in the Odata query.
- Label Displayed text in front of the input field
- Type Input type: String (text), Long (number), Boolean (Yes/No) or Date (date)
- Length Maximum length for strings
- Sort Sort value against the other parameters
- Query The query for the query on the service is written with OData v4. From the list of supported operations the following are possible:
expand
,filter
,orderby
,select
,top
. The columns from the list are always stored infields/
, so it is important that all operations (excepttop
) always have the prefixfields/
. E.g.<select>fields/firstname</select>
. The search parameters can be referenced within the query using{SearchParamId}
.- Expand The
Expand
operator can be used to expand multi-dimensional/linked fields. Classic examples are linked persons and address. Default isfields
. - Filter The
Filter
operator can be used to filter the entries based on the entered search values. List of comparison operators. Caution, note restrictions below. - OrderBy The
OrderBy
operator can be used to sort the entries by specific columns. Default is unsorted. - Select with the
Select
operator the returned columns/information can be restricted. Default is all information selected. - Top The
Top
operator can be used to limit the maximum number of returned results. Default is 50.
- Expand The
- Debug
true
if additional information should be logged (available values with names for the mapping, more detailed error messages). - Mapping For SharePoint lists it is mandatory to define a default contact mapping. Without mapping the entries cannot be processed. For mapping the column names are used as
SourceAttribute
. Exceptions are fields of typelocation
andlink
.- Location
- Locality information is automatically split by Sharepoint into several columns. These then do not contain the column name, but the English designation: Street, PostalCode, City etc.. The complete address is added with DispName. If there are several columns of type
location
in a list, they will be numbered from left to right, starting with the second address with 0, e.g.Street
,Street0
,Street1
for three addresses. - OneOffixx also prepares the addresses itself with
ColumnName.address.City
and so on.
- Locality information is automatically split by Sharepoint into several columns. These then do not contain the column name, but the English designation: Street, PostalCode, City etc.. The complete address is added with DispName. If there are several columns of type
- Link
- Links are returned by SharePoint splitted into url and display name:
ColumnName.Url
,ColumnName.Description
.
- Links are returned by SharePoint splitted into url and display name:
- Location
- Icon Base64 icon displayed to the user in the recipient dialog.
Warning
Für die Filterquery gibt es einige Einschränkungen:
There are some restrictions for the filter query:
- Only indexed columns can be searched. MS documentation on adding indexed columns
- Contrary to Microsoft's comparison operator documentation, the
contains(FieldName, 'SearchValue')
comparison operator does not work! You have to usesubstringof('SearchValue',FieldName)
instead. - Empty values are not considered part of the content when using substringof. This has as consequence that if not all search parameters have a value, no entry will be found. For this reason, the filter query was built in such a way that several
<Filters></Filters>
can be defined within the<Filter></Filter>
. A<Filter></Filter>
is only considered if a value has been entered for each search parameter it contains:
<Filters>
<Filter>substringof('{street}', fields/Street)</Filter> <!-- Wird nur ausgeführt, wenn street ausgefüllt ist -->
<Filter>substringof('{firstName}', fields/Vorname) and substringof('{street}', fields/Street)</Filter> <!-- Wird nur ausgeführt, wenn street und firstName ausgefüllt sind -->
</Filters>