---
title: "LSLookup(Link Storage Code, Link Field value)"
description: "Retrieve value for a key from the specified Link Storage"
keywords: "LSLOOKUP"
url: "https://myrapidi.com/wiki/lslookup"
locale: "en"
published: "2016-11-29T16:02:36Z"
modified: "2025-05-22T16:16:39Z"
---

With the LSLookup function, you can retrieve values from [Link Storages](https://myrapidi.com/wiki/link_storages.md). You specify the Link Storage Code as the first parameter and the value to be used for the lookup as the second parameter.  
  

If the Link Storage has a key that is combined with more than one field, you need to make a formula that composes the total string to be used as the lookup value (see examples below).  
  

You can use the LSLookup function to retrieve values in a reverse way - i.e. you supply the value for the 2nd column and get the value in the 1st column back from the function. To achieve this, you add "#REVERSE" to the Link Storage Code. For example LSLookup('CUST'+'#REVERSE',"AccountId") &nbsp;

&nbsp;  
  

**Example 1:**  
  

> **##LSLookup('CUST', "No.")**  
>   
> This will retrieve the Account Id corresponding to the Customer No. in NAV (provided that the Link Storage CUST contains NAV Customer No's and corresponding SFDC Account Ids.

**&nbsp;**  
  

**Example 2:**  
  

> **##LSLookup('ITEM',"ITEMNMBR")**  
>   
> This will retrieve the Product Id corresponding to the Item Number in GP (provided that the Link Storage ITEM contains GP Item No's and corresponding SFDC Product Ids.

&nbsp;  
  

**Example 3:**  
  

> **##LSLookup('CUST'+'#REVERSE',"AccountId")**  
>   
> This will retrieve the NAV Customer No. corresponding to the SFDC Account Id (provided that the Link Storage Cust contains NAV Customer No's and corresponding SFDC Account Ids.

**Example 4:**  
  

> **##LSLookup('SALESORDER', "Document Type"+'#'+"Document No.")**  
>   
> This will retrieve the SalesHeader Id corresponding to the SalesOrder Document Type and Document No. in NAV (provided that the Link Storage SALESORDER contains NAV SalesOrder Document Type + Document No's and the corresponding SFDC SalesHeader Ids.  
> This formula would typecally be used in the Field List on a Sales Line Transfer.  
>   
> &nbsp;
