Delete Storage Data

You can delete the stored data in two ways:

via Widget

To delete the stored data from the connected database via Widget, 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 delete the stored data as given here.

    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, your data stored against the specific key value will be deleted successfully.

Also, you can easily clear the stored data in the database at once, while developing the extension itself. For this, you have to enable the Developer Mode. Once you enable it, Clear Storage option will be available in more actions of the specific extension header.

 

Sample Request

CopiedZOHODESK.delete('database',{'queriableValue':'test'}).then(function(res)
{
    // success response
    // {"database.delete":"delete": "success"}}
}
.catch(function (err) {
    // failure response
    // {errMsg: 'Invalid Payload'}
})

via Functions

You can delete the stored data from the database via functions, by specifying the key.

  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 stored against the specified key will be deleted successfully.

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

storage = invokeurl
[
 	url: "https://desk.zoho.com/api/v1/installedExtensions/"+installationId+"/storage?key=001"
 	type: DELETE
 	headers: head
 	connection: "testing"
 ];