---
schema_version: "1"
id: cf4446cdaebf0b9f4a6f31398bfa3e31b6d165340136a20dd6219026f1874345
title: getParametersAsJSON()
collection: legacydeveloper
version: current
locale: en-us
portal_url: https://docs.salesforce.com/legacydeveloper/current/en-us/apexref/apex_canvas_EnvironmentContext_getParametersAsJSON.md
canonical_url: https://developer.salesforce.com/docs/atlas.en-us.apexref.meta/apexref/apex_canvas_EnvironmentContext_getParametersAsJSON.htm
source_site: developer.salesforce.com
content_type: documentation
content_hash: 0a8b076f0c60baae1b343d007f445a105ee0749380ad9259198c62e7f8aaeb6b
description: Retrieves the current custom parameters for the canvas app. Parameters are returned as a JSON string.
---
# getParametersAsJSON()

Retrieves the current custom parameters for the canvas app. Parameters are returned as a JSON string.

## Signature

public String getParametersAsJSON()

## Return Value

Type: [String](https://developer.salesforce.com/docs/atlas.en-us.apexref.meta/apexref/apex_methods_system_string.htm#apex_methods_system_string "Contains methods for the String primitive data type.")

## Usage

Use this method to get the current custom parameters for the canvas app. The parameters are returned in a JSON string that can be de-serialized by using the [System.JSON.deserializeUntyped(jsonString)](https://developer.salesforce.com/docs/atlas.en-us.apexref.meta/apexref/apex_class_System_Json.htm#apex_System_Json_deserializeUntyped "Deserializes the specified JSON string into collections of primitive data types.") method.

Custom parameters can be modified by using the [Canvas.EnvironmentContext.setParametersAsJSON(jsonString)](https://developer.salesforce.com/docs/atlas.en-us.apexref.meta/apexref/apex_canvas_EnvironmentContext_setParametersAsJSON.htm "Sets the custom parameters for the canvas app.") string.

## Example

This example gets the current custom parameters, de-serializes them into a map, and prints the results to the debug log.

Canvas.EnvironmentContext env = renderContext.getEnvironmentContext();

// Get current custom params
Map<String, Object\> currentParams = 
    (Map<String, Object\>) JSON.deserializeUntyped(env.getParametersAsJSON());
System.debug('Environment Context custom paramters: ' + currentParams);