Package 'appsheet'

Title: An Interface to the 'AppSheet' API
Description: Functionality to add, delete, read and update table records from your 'AppSheet' apps, using the official API <https://api.appsheet.com/>.
Authors: Samuel Calderon [aut, cre, cph]
Maintainer: Samuel Calderon <[email protected]>
License: MIT + file LICENSE
Version: 0.1.0.9000
Built: 2025-02-20 05:15:19 UTC
Source: https://github.com/calderonsamuel/appsheet

Help Index


Appsheet Function

Description

This function interacts with the AppSheet API to perform actions on a specified table. For more info, check the official documentation.

Usage

appsheet(
  tableName,
  Action = "Find",
  Properties = ash_properties(),
  Rows = list(),
  appId = Sys.getenv("APPSHEET_APP_ID"),
  access_key = Sys.getenv("APPSHEET_APP_ACCESS_KEY")
)

Arguments

tableName

The name of the table to perform actions on.

Action

The action to be performed on the table, one of ("Find", "Add", "Delete", "Edit"). Default is "Find", which reads a table.

Properties

A list of properties for the action. ash_properties() provides sensible defaults, but can be customized.

Rows

A list of rows for the action. Default is an empty list.

appId

The AppSheet application ID. Default is retrieved from the APPSHEET_APP_ID environment variable.

access_key

The AppSheet application access key. Default is retrieved from the APPSHEET_APP_ACCESS_KEY environment variable.

Value

A data frame containing the response from the AppSheet API.

Examples

## Not run: 
appsheet("my_table")
appsheet("my_table", Properties = ash_properties(Locale = "en-GB"))

## End(Not run)

Build the properties of an Appsheet request

Description

This function exist to provide auto completion. Still, it is likely that users will need to visit the official documentation for further customization.

Usage

ash_properties(
  Locale = "en-US",
  Location = NULL,
  RunAsUserEmail = NULL,
  Timezone = NULL,
  UserSettings = NULL,
  Selector = NULL,
  ...
)

Arguments

Locale

Locale of the client making the request. For example, en-US indicates English, United States. If this value is not specified, Locale defaults to en-US.
The Locale is used when validating Date, DateTime, Decimal, Percent, Price, and Time data values. For example, when Locale is en-US, date values must be entered in MM/DD/YYYY format; when Locale is en-GB, date values must be entered in DD/MM/YYYY format.

Location

Latitude and longitude of the client making the request. If not specified, Location defaults to 0.000000, 0.000000.

RunAsUserEmail

User email address of the person taking the action. The action is performed under the user email address you specify. If this value is not specified, the action is performed under the user email address of the application owner.

Timezone

Timezone of the client making the request.

UserSettings

User setting to be used when performing the action. If not specified, no user settings are used.

Selector

Expression to select and format the rows returned. Only valid when Action is "Find".

...

Placeholder for future properties to be introduced in the API.

Details

Any NULL will be internally dropped before performing the request.

Value

A list of properties

Examples

ash_properties()
ash_properties(Locale = "en-GB")

Appsheet request builder

Description

Appsheet request builder

Usage

ash_request(
  tableName,
  Action = "Find",
  Properties = ash_properties(),
  Rows = list(),
  appId = Sys.getenv("APPSHEET_APP_ID"),
  access_key = Sys.getenv("APPSHEET_APP_ACCESS_KEY")
)

Arguments

tableName

The name of the table to perform actions on.

Action

The action to be performed on the table, one of ("Find", "Add", "Delete", "Edit"). Default is "Find", which reads a table.

Properties

A list of properties for the action. ash_properties() provides sensible defaults, but can be customized.

Rows

A list of rows for the action. Default is an empty list.

appId

The AppSheet application ID. Default is retrieved from the APPSHEET_APP_ID environment variable.

access_key

The AppSheet application access key. Default is retrieved from the APPSHEET_APP_ACCESS_KEY environment variable.

Value

An httr2 request