Lookup a value from Data Source A. This is functionally equivalent to LOOKUPB except that it uses Data Source A (Source) as the connection.
It enables you to lookup values within your source data source connection, you can connect to other entities/items/tables like when you are using the connection library.
object LOOKUPA(string column, FROM(from), keyValue)
object LOOKUPA(string columnName, LFROM from, params KVAL[] keyValues)
This function supports looking up OptionSet values from Entity OptionSets. In this example the option set data source is a simple id, name data set.
To lookup an id value for a given OptionSet name use the following syntax entity|optionset
in the from
part of the lookup function.
LOOKUPA("id","account|industrycode". WHEN("name", "Financial"))
Sometimes you may need to specify a specific URL to the SharePoint list you want to perform a lookup on, if that list is not in the site specified in Data Source A. For example if Data Source A was running in a sub-site of SharePoint and the required list is located in the root site of SharePoint Data Sync's Lookup functions can handle extended formats that override the settings that are typically gathered from the data source properties. Using calculated columns we can use the LOOKUP function to pass the SharePoint site as part of the expression.
LOOKUPA(string column, FROM(KV(string parameter, string location/url), KV(string valueParameter, string valueName)), WHEN(string value, object))
Object | Data Type | Description |
---|---|---|
column | String | The column name to find. |
parameter | String | The parameter to override. |
location/url | String | The location to find the parameter to override with, e.g. a URL. |
valueParameter | String | The value you are looking for. |
valueName | String | The name of the valueParameter you are looking for. |
value | String | The value you are looking for. |
object | String | The object you are looking to match the value to. |
In this example we can get the User ID from the User Information List in the root site whilst running in the sub-site.
LOOKUPA("ID", FROM(KV("SharePointUrl","https://simegoltd.sharepoint.com/"), KV("ListName","User Information List")), WHEN("Name",Title))