Get Storage Data

You can get the stored data in two ways:

via Widget

To retrieve the stored data from the connected database of the extension, follow the instructions given below:

  1. In your local drive, go to your Project folder which you created initially while building your first widget.
  2. Open widget.html file in app folder, with the help of editor.
  3. In widget.html file, provide the Request to get the data from database.
     This request includes two parameters: key and queriableValue. And the request must include at least one of these parameters.
  4. Save the file.
  5. Pack and publish the extension.

Now, the required data will be successfully retrieved from the database. This data can be used to develop the code functionalities of your extension.


CopiedZOHODESK.get('database', {queriableValue :'Production_Department'}).then(function(response){
   // success response
  //response = {"database.get":{"data":[{"queriableValue":"Production_Depart ment","value {"name":"zylker"},"key":"001"}]}}
   // failure response
   // {errMsg: 'Invalid Payload'}

via Functions

To fetch the stored data via functions, follow the steps given below:

  1. Go to Sigma > Functions > Add Function > Create your function.
  2. In the function editor, provide the given sample request.

    In this request, a connection will be used to store the data. For that connection, scopes should hold the value 'Desk.extensions.ALL'.

  3. Save the function.
  4. Associate function with the extension.
  5. Publish the extension.
    Now, the data will be successfully retrieved from the database by calling this function. This data can be used effectually for developing your extension.

Sample Request

Copiedhead = Map();
head.put("orgId", data.get('integ_scope_id'));
installationId = data.get('service_app_id');

storage = invokeurl
 url: ""+installationId+"/storage?key=001&queriableValue=Production_Department"
	type: GET
 headers: head
 connection: "testing"