1. Home
  2. Docs
  3. Custom API
  4. Fetch Sheet Values

Fetch Sheet Values

You can even fetch sheet values to the DigiXport addon by using the “<<>>” placeholder.

So if you’re fetching sheet value from say sheet named “Data” and cell “A1”. You can enter : <<Data!A1>> 

For fetching sheet range you can use:  <<Data!A1:A10>> 

The placeholders can be used in

Let’s take an example

Sheet Values in API Url

If you want to fetch data from say cell A2 and sheet named “Sheet”, you can use: <<Sheet!A2>>

 

If you want to fetch multiple URL, you can simply input the range. In the below example, the request would be sent for the URLs from A2 to A4. For EG: <<Sheet!A2:A4>>

customapi_sheetvalue_apiurl_multiple

 

If you want to fetch (parameter or path) value from the sheet to an existing URL, you can input it as : URL?api_key=<<Sheet!A1>>

EG: www.example.com?api_key=<<Sheet!A1>>   Or www.example.com/<<Sheet!A1>> 

 

customapi_sheetvalue_apiurl_inline_single

 

If you use range values in the API Url, then it will concatenate it as a string. So For Eg: www.example.com?fields=<<Sheet!A1:A4>> will be converted to  www.example.com?fields=id,name,date

 

customapi_sheetvalue_apiurl_inline_multiple

 

Sheet Values in Headers

To fetch a single sheet value in headers, you can use the format as mentioned above. For Eg:  “<<Sheet!A1>>“.

customapi_sheetvalue_header_single

 

If you use sheet ranges as “<<Sheet!A1:A4>>” in the headers, it will simply concatenate the data fetched from the sheet cell A1, A2, A3, A4.

 

Sheet Values in Request Body/Payload

The functioning of the fetching of the sheet values in request payload is similar to the ones in the headers.

In the below example, you can paste the JSON payload in the sheet cell and fetch it using <<Sheet!A2>>

customapi_sheetvalue_request_body_single

If you have JSON across multiple cells, you can even input the range. In the below case, you can see the JSON is in the cell A2 and A3. You can enter range as: <<Sheet!A2:A3>>

 

customapi_sheetvalue_request_body_multiple

NOTE: If the JSON if formatted incorrectly, you will receive an error.

 

Use Cases

  • Some APIs require you to use dates as parameters. So you can simply input the date in the sheet and fetch it via the placeholders.
    EG: https://www.example.com?start_date=<<Sheet!A1>>&end_date=<<Sheet!B1>>

Leave a Reply

Your email address will not be published. Required fields are marked *