CloudExpression
✖
CloudExpression
represents a cloud expression with a given URI.
represents the part of a cloud expression specified by the parti.
Details and Options



- CloudExpression["name"] immediately evaluates to CloudExpression[uri], where the path for the URI is determined by the value of $CloudExpressionBase.
- The value stored in a cloud expression can be any Wolfram Language expression.
- When the value consists of nested lists and associations, lookup and updating of parts is handled directly in the cloud.
- CloudExpression[…][part1,part2,…] retrieves the value of the specified part of the cloud expression.
- CloudExpression[…][] retrieves the value of the entire cloud expression.
- CloudExpression[…][part1,part2,…]=value sets the value of part of a cloud expression.
- The following operations can be performed on CloudExpression objects:
-
Get get the complete value of the cloud expression Put put a new complete value into the cloud expression Part return a cloud expression object that represents the part Set assign new values to parts of the cloud expression Unset remove parts from the cloud expression AppendTo append to a list or association within the cloud expression AssociateTo associate a new value to a key in an association AddTo,Increment,… add, increment, etc. parts in the cloud expression DeleteCloudExpression delete the cloud expression Length return the length of the cloud expression KeyExistsQ test if a key exists in the cloud expression SetOptions set options associated with the cloud expression Options get the options associated with the cloud expression SetPermissions set permissions of the cloud expression ClearPermissions clear permissions of the cloud expression - CloudExpression[…][[part1,part2,…]] gives CloudExpression[…,part1,part2,…], from which the value can be retrieved using Get.
- Cloud expressions have the following options, whose values are stored in the cloud:
-
PartProtection Automatic which parts are protected from change Permissions Automatic permissions for access etc. - After creating a cloud expression with CreateCloudExpression, options for cloud expressions can be retrieved using Options and changed using SetOptions.
- In associations, when a mutable operation is applied to a missing key, the associated value is initialized before the operation is applied.
-
Set associate the missing key to the value specified in Set AssociateTo initialize the value to an empty association AppendTo initialize the value to an empty list AddTo, Increment, ... initialize the value to 0 TimesBy, DivideBy initialize the value to 1
Examples
open allclose allBasic Examples (2)Summary of the most common use cases
Create an anonymous cloud expression storing a list:

https://wolfram.com/xid/05fd5ypoj2-t0o2qt

Retrieve a part from the cloud expression:

https://wolfram.com/xid/05fd5ypoj2-o5swqs

Reset a part in the cloud expression:

https://wolfram.com/xid/05fd5ypoj2-86xso7

Get the value of the whole cloud expression:

https://wolfram.com/xid/05fd5ypoj2-kjlza1

Append a value to the cloud expression:

https://wolfram.com/xid/05fd5ypoj2-nl8hj4

https://wolfram.com/xid/05fd5ypoj2-gumky6
Get the final value of the whole cloud expression:

https://wolfram.com/xid/05fd5ypoj2-4osphe

Create an anonymous cloud expression storing an association:

https://wolfram.com/xid/05fd5ypoj2-u36bml


https://wolfram.com/xid/05fd5ypoj2-mq3322

https://wolfram.com/xid/05fd5ypoj2-qt53o7

https://wolfram.com/xid/05fd5ypoj2-nwn1cw
Get the final value of the whole cloud expression:

https://wolfram.com/xid/05fd5ypoj2-bbervl

Scope (9)Survey of the scope of standard use cases
Store an integer as a cloud expression:

https://wolfram.com/xid/05fd5ypoj2-8erl9i

Increment the integer multiple times:

https://wolfram.com/xid/05fd5ypoj2-goayw

https://wolfram.com/xid/05fd5ypoj2-cufyra

Decrement the value by number:

https://wolfram.com/xid/05fd5ypoj2-6poant

https://wolfram.com/xid/05fd5ypoj2-hr3os1


https://wolfram.com/xid/05fd5ypoj2-7u47xb


https://wolfram.com/xid/05fd5ypoj2-tv24xj


https://wolfram.com/xid/05fd5ypoj2-t51k9

Set the sequence to a new value:

https://wolfram.com/xid/05fd5ypoj2-l98t3h

https://wolfram.com/xid/05fd5ypoj2-80580c


https://wolfram.com/xid/05fd5ypoj2-go4a3d

https://wolfram.com/xid/05fd5ypoj2-quvqhm

https://wolfram.com/xid/05fd5ypoj2-33sy2h

Store a list of lists as a cloud expression:

https://wolfram.com/xid/05fd5ypoj2-skihty

Retrieve the cloud expression and display it as a rectangular matrix:

https://wolfram.com/xid/05fd5ypoj2-t0hnci


https://wolfram.com/xid/05fd5ypoj2-qa9xtp


https://wolfram.com/xid/05fd5ypoj2-p5qhs2

Set the entire first column to 0:

https://wolfram.com/xid/05fd5ypoj2-67pklf

https://wolfram.com/xid/05fd5ypoj2-9kp9cj

Add 2 to the value of the last row:

https://wolfram.com/xid/05fd5ypoj2-3kpyi1

https://wolfram.com/xid/05fd5ypoj2-0etgku

Set the value of the last element of the last row:

https://wolfram.com/xid/05fd5ypoj2-wpzsyy

https://wolfram.com/xid/05fd5ypoj2-7vh8oy


https://wolfram.com/xid/05fd5ypoj2-rla868

https://wolfram.com/xid/05fd5ypoj2-youhpe

https://wolfram.com/xid/05fd5ypoj2-p6q1p1

Create a new cloud expression composed of an association:

https://wolfram.com/xid/05fd5ypoj2-77i3c0


https://wolfram.com/xid/05fd5ypoj2-whctah

Add a new key using AppendTo:

https://wolfram.com/xid/05fd5ypoj2-p20kj3

https://wolfram.com/xid/05fd5ypoj2-u3o0ll

Looking up a key that does not exist will return a Failure object:

https://wolfram.com/xid/05fd5ypoj2-1mscm3

Attempting to update values associated with key "c" while PartProtection is set to Automatic produces a Failure object:

https://wolfram.com/xid/05fd5ypoj2-sz0ywp

Change the PartProtection value to None, allowing arbitrary update operations:

https://wolfram.com/xid/05fd5ypoj2-ri3rar

https://wolfram.com/xid/05fd5ypoj2-rjla9x


https://wolfram.com/xid/05fd5ypoj2-soky40

Create a new cloud expression:

https://wolfram.com/xid/05fd5ypoj2-pdecsy

Define an unevaluated representation of the part "a" of the cloud expression:

https://wolfram.com/xid/05fd5ypoj2-07xk1o

Retrieve the value associated with key "a":

https://wolfram.com/xid/05fd5ypoj2-qync7g

Add an element to the list associated with key "a":

https://wolfram.com/xid/05fd5ypoj2-q1qh88


https://wolfram.com/xid/05fd5ypoj2-nrctug

Create a new cloud expression containing an integer and a real:

https://wolfram.com/xid/05fd5ypoj2-b0kksw

Cloud expressions support in-place addition when operating on machine-precision numbers:

https://wolfram.com/xid/05fd5ypoj2-cgyxiu

https://wolfram.com/xid/05fd5ypoj2-z6y09y

Cloud expressions support in-place multiplication:

https://wolfram.com/xid/05fd5ypoj2-plv9d5

https://wolfram.com/xid/05fd5ypoj2-kitrb2

Cloud expressions support in-place division, where the results are coercing to real numbers:

https://wolfram.com/xid/05fd5ypoj2-g101ou

https://wolfram.com/xid/05fd5ypoj2-nijopu

Any expression can be stored in a cloud expression:

https://wolfram.com/xid/05fd5ypoj2-clome3

https://wolfram.com/xid/05fd5ypoj2-y2vjvo

Part extraction on arbitrary expressions is not supported:

https://wolfram.com/xid/05fd5ypoj2-utcsss

Create a new cloud expression containing a list of associations:

https://wolfram.com/xid/05fd5ypoj2-9bdyys

Cloud expressions support Length:

https://wolfram.com/xid/05fd5ypoj2-6mkxqy

Parts of a cloud expression also support Length:

https://wolfram.com/xid/05fd5ypoj2-twraho

Create a new cloud expression containing a list of associations with different keys:

https://wolfram.com/xid/05fd5ypoj2-qotz05

Cloud expressions support KeyExistsQ:

https://wolfram.com/xid/05fd5ypoj2-2lertl


https://wolfram.com/xid/05fd5ypoj2-nef82w

KeyExistsQ also works on parts of a cloud expression:

https://wolfram.com/xid/05fd5ypoj2-5qhrdn


https://wolfram.com/xid/05fd5ypoj2-fg6l34

Options (2)Common values & functionality for each option
PartProtection (1)

https://wolfram.com/xid/05fd5ypoj2-q8ssmc

Set its PartProtection to All, protecting it against any sort of update:

https://wolfram.com/xid/05fd5ypoj2-fmvau1

Trying to update any value produces a Failure object:

https://wolfram.com/xid/05fd5ypoj2-2aorfd

Permissions (1)

https://wolfram.com/xid/05fd5ypoj2-nipv0o

Set cloud expression permissions to public, allowing access by any cloud user:

https://wolfram.com/xid/05fd5ypoj2-sinw2o

Use a permission group to grant read permission to any users in a named group:

https://wolfram.com/xid/05fd5ypoj2-d7ju44

Properties & Relations (8)Properties of the function, and connections to other functions
Create a cloud expression storing a list:

https://wolfram.com/xid/05fd5ypoj2-yxuy5

The entire expression stored in a cloud expression can be replaced with Put:

https://wolfram.com/xid/05fd5ypoj2-p3u28d

The existing value can be retrieved with Get:

https://wolfram.com/xid/05fd5ypoj2-oc4jkt

Get[CloudExpression[…]] is equivalent to the short form CloudExpression[…][]:

https://wolfram.com/xid/05fd5ypoj2-mekrct


https://wolfram.com/xid/05fd5ypoj2-9hit6j

DeleteCloudExpression deletes a cloud expression:

https://wolfram.com/xid/05fd5ypoj2-2o14t
Create a cloud expression storing a list:

https://wolfram.com/xid/05fd5ypoj2-5gpbac

AppendTo adds a new element at the end of the list:

https://wolfram.com/xid/05fd5ypoj2-n9lzlx


https://wolfram.com/xid/05fd5ypoj2-2bddjn

AppendTo also works on Association:

https://wolfram.com/xid/05fd5ypoj2-2ti4w5

If the key is not already in the association, the key-value pair is added:

https://wolfram.com/xid/05fd5ypoj2-s0b5sg


https://wolfram.com/xid/05fd5ypoj2-9p3nam

AppendTo changes the value associated with an existing key:

https://wolfram.com/xid/05fd5ypoj2-wcu96j


https://wolfram.com/xid/05fd5ypoj2-szztxe

Create a cloud expression storing an association:

https://wolfram.com/xid/05fd5ypoj2-dtcuf9

AppendTo will add an entry at the end of the association, if the key does not already exist:

https://wolfram.com/xid/05fd5ypoj2-jc24mb
Existing keys are updated and moved to the end:

https://wolfram.com/xid/05fd5ypoj2-pxix1m

https://wolfram.com/xid/05fd5ypoj2-cteadr

AssociateTo will not reorder the entry if it already exists:

https://wolfram.com/xid/05fd5ypoj2-8iyebv

https://wolfram.com/xid/05fd5ypoj2-2lm50i

Store a list of lists as a cloud expression:

https://wolfram.com/xid/05fd5ypoj2-qg4c1w

Remove the last elements of each list with Unset:

https://wolfram.com/xid/05fd5ypoj2-zfwxln

https://wolfram.com/xid/05fd5ypoj2-8zqanr

Set part protection to None:

https://wolfram.com/xid/05fd5ypoj2-t7eueu

With part protection set to None, it is possible to remove the first list:

https://wolfram.com/xid/05fd5ypoj2-o8r5k4

https://wolfram.com/xid/05fd5ypoj2-kx1ojk

Cloud expressions can be used to efficiently count events. Start by storing an association in a cloud expression:

https://wolfram.com/xid/05fd5ypoj2-si9t4i


https://wolfram.com/xid/05fd5ypoj2-wc1c4w
Increment the counters for a random set of users. Values are automatically initialized to zero before being incremented if they do not already exist:

https://wolfram.com/xid/05fd5ypoj2-mb0sen

https://wolfram.com/xid/05fd5ypoj2-r3s3bx

Cloud expressions can be used to collect metadata from things like HTTP requests. Start by storing an association in a cloud expression:

https://wolfram.com/xid/05fd5ypoj2-7v609z

Prepare a list of associations representing HTTP requests. Each contains the user name and the user-agent of a client making a request:

https://wolfram.com/xid/05fd5ypoj2-bt0r25
Collect metadata by randomly selecting users, representing clients making HTTP requests. Values are automatically initialized to an empty list before the AppendTo operation is performed if they do not already exist:

https://wolfram.com/xid/05fd5ypoj2-0xljga

https://wolfram.com/xid/05fd5ypoj2-ciynz5

Use FileByteCount to get the cloud storage used by a cloud expression:

https://wolfram.com/xid/05fd5ypoj2-qine2i


https://wolfram.com/xid/05fd5ypoj2-gw5iej

Possible Issues (4)Common pitfalls and unexpected behavior
Cloud expressions do not support PrependTo:

https://wolfram.com/xid/05fd5ypoj2-8x6dt5

https://wolfram.com/xid/05fd5ypoj2-4fwb81


Operations on nested missing keys within a cloud expression are not supported:

https://wolfram.com/xid/05fd5ypoj2-fc7h56

Associating a score value to a missing user returns a failure object:

https://wolfram.com/xid/05fd5ypoj2-up3m2c

If needed, KeyExistsQ can be used to initialize the value for the new keys:

https://wolfram.com/xid/05fd5ypoj2-dtv54x
Insert the nested key, automatically initializing "last_score" to an empty association prior to the Set operation:

https://wolfram.com/xid/05fd5ypoj2-h56hau

Trying to set or delete a nonatomic value will fail if PartProtection->None is not set:

https://wolfram.com/xid/05fd5ypoj2-ye5io4


https://wolfram.com/xid/05fd5ypoj2-i8plgf

Use SetOptions to allow the modification:

https://wolfram.com/xid/05fd5ypoj2-eow0ro


https://wolfram.com/xid/05fd5ypoj2-dxxpct

https://wolfram.com/xid/05fd5ypoj2-m9elid

Numbers that cannot be represented as 64-bit machine integers or real numbers can be stored in cloud expressions:

https://wolfram.com/xid/05fd5ypoj2-xe8qe


https://wolfram.com/xid/05fd5ypoj2-4p0s9x

In-place arithmetic operations on extended-precision integers can cause the integer to be coerced to a real number:

https://wolfram.com/xid/05fd5ypoj2-ew2z7d

https://wolfram.com/xid/05fd5ypoj2-jpiyai

If an arithmetic operation is attempted on an extended-precision integer or real number, and the number cannot be coerced to a machine-size number, a failure object will be returned and the operation will not be performed:

https://wolfram.com/xid/05fd5ypoj2-jvxgnl

Neat Examples (3)Surprising or curious use cases
Store a family of polyhedra as an association:

https://wolfram.com/xid/05fd5ypoj2-sthc41

https://wolfram.com/xid/05fd5ypoj2-gs1ylu

Store the polyhedra in the cloud as an association:

https://wolfram.com/xid/05fd5ypoj2-y2j116


https://wolfram.com/xid/05fd5ypoj2-ziquhb

Retrieve a polyhedron by its standard name:

https://wolfram.com/xid/05fd5ypoj2-k1m8gm

Build a web form to perform a survey of vital statistics. First create a cloud expression to gather the data:

https://wolfram.com/xid/05fd5ypoj2-ldmzrb

Create a form storing anonymous body information of the user:

https://wolfram.com/xid/05fd5ypoj2-ie9s0m


https://wolfram.com/xid/05fd5ypoj2-6f37sw

Let users submit data. Then, build an histogram of the ages from the user inputs:

https://wolfram.com/xid/05fd5ypoj2-xth6bx


https://wolfram.com/xid/05fd5ypoj2-1svdjr
Compute the body mass index (BMI) associated to each submission:

https://wolfram.com/xid/05fd5ypoj2-fd1ch
Plot an histogram of the BMI values by sex:

https://wolfram.com/xid/05fd5ypoj2-fzan3q

Create a cloud expression to log usage of a form function:

https://wolfram.com/xid/05fd5ypoj2-9nn3n

Create a form function that identifies the language of the requested string. The form function will also log the result of the request, the ID of the cloud user making the request, and the time spent:

https://wolfram.com/xid/05fd5ypoj2-qt6cwg

Deploy the form to a public cloud object:

https://wolfram.com/xid/05fd5ypoj2-sw9dud

Retrieve the list of identified languages after a few submissions:

https://wolfram.com/xid/05fd5ypoj2-nsoudq

Plot the date histogram from the data collected:

https://wolfram.com/xid/05fd5ypoj2-5hy5n1

Get a detailed report of a given user activity:

https://wolfram.com/xid/05fd5ypoj2-qg277l

Wolfram Research (2016), CloudExpression, Wolfram Language function, https://reference.wolfram.com/language/ref/CloudExpression.html (updated 2021).
Text
Wolfram Research (2016), CloudExpression, Wolfram Language function, https://reference.wolfram.com/language/ref/CloudExpression.html (updated 2021).
Wolfram Research (2016), CloudExpression, Wolfram Language function, https://reference.wolfram.com/language/ref/CloudExpression.html (updated 2021).
CMS
Wolfram Language. 2016. "CloudExpression." Wolfram Language & System Documentation Center. Wolfram Research. Last Modified 2021. https://reference.wolfram.com/language/ref/CloudExpression.html.
Wolfram Language. 2016. "CloudExpression." Wolfram Language & System Documentation Center. Wolfram Research. Last Modified 2021. https://reference.wolfram.com/language/ref/CloudExpression.html.
APA
Wolfram Language. (2016). CloudExpression. Wolfram Language & System Documentation Center. Retrieved from https://reference.wolfram.com/language/ref/CloudExpression.html
Wolfram Language. (2016). CloudExpression. Wolfram Language & System Documentation Center. Retrieved from https://reference.wolfram.com/language/ref/CloudExpression.html
BibTeX
@misc{reference.wolfram_2025_cloudexpression, author="Wolfram Research", title="{CloudExpression}", year="2021", howpublished="\url{https://reference.wolfram.com/language/ref/CloudExpression.html}", note=[Accessed: 26-March-2025
]}
BibLaTeX
@online{reference.wolfram_2025_cloudexpression, organization={Wolfram Research}, title={CloudExpression}, year={2021}, url={https://reference.wolfram.com/language/ref/CloudExpression.html}, note=[Accessed: 26-March-2025
]}