Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Table plus
applyColStyleToCelltrue
heading0
columnTypess,s,s,s
multiplefalse
columnAttributesstyle="background:#e5e7ea;font-weight:bold,,style="background:#e5e7ea;font-weight:bold,
enableSortingfalse

Syntax

comalaSetState(

...

pageId, workflowState, [comment

...

])

Package

comala

Alias

Pkg Usage

Description

Excerpt
hiddentrue
Sets the workflow state of the page using the Comala

...

Document Management add-on.

Parameters

...

Parameter name

...

Type

...

Required

...

Description

...

json

...

string

...

Yes

...

The JSON to be converted.

Return type

variable return type - depending on the left hand side operator type

Examples

Both examples show how JSON data can be parsed into an array or struct collections. Both examples use the following struct definitions:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15

struct code {
    number [] rgba;
    string hex;
}
 
struct color {
    string color;
    string category;
    string type;
    code code;
}
 
struct colors {
    color [] colors;
}

Example 1 - Reading JSON from a file

16
17
18
19
20
21
22

string json = readFromTextFile("C:\\colors.json");
 
 
colors cData;
cData = fromJson(json);
 
return cData.colors[0].color;

Example 2 - Reading JSON from a variable

16
17
18
19
20
21

string json = "{\"colors\":[{\"color\":\"red\",\"category\":\"hue\",\"type\":\"primary\",\"code\":{\"rgba\":[255,0,0,1],\"hex\":\"#FF0\"}}]}";
 
colors cData;
cData = fromJson(json);
 
return cData.colors[0].color;

See also

...

Page:
httpGet

...

Page:
httpDelete

...

Page:
httpOptions

...

Page:
httpPatch

...

Page:
httpPost

...

Page:
httpPut

...

Page:
httpCreateCookie (Cloud)

...

Page:
httpGet (Cloud)

...

Page:
httpGetErrorMessage (Cloud)

...

Page:
httpDelete (Cloud)

...

Page:
httpCreateParameter (Cloud)

...

Page:
httpCreateHeader (Cloud)

...

Page:
httpBasicAuthHeader (Cloud)

...

Page:
fromJson (Cloud)

...

Sets the workflow state of the page using the Comala Document Management add-on.

Parameters

Table plus
applyColStyleToCelltrue
columnTypess,s,s,s
heading0
multiplefalse
enableSortingfalse

Parameter name

Type

Required

Description

pageId

Integer

Yes

The selected page to change the workflow state on.

workflowState

String

Yes

Name of the workflow state to be set to.

comment

String

Yes

Comment to be added to the Comala workflow history.

Return Type

Boolean

Example

Code Block
languagejs
return comalaSetState(getPage("TST", "Demo Page"), "Approved", "Page was approved by: " + currentUserFullName());

Returns 'true'

See also

Filter by label (Content by label)
showLabelsfalse
max25
showSpacefalse
cqllabel = "comala_routines" and space = currentSpace ( )
labelsarray_routines

We've encountered an issue exporting this macro. Please try exporting this page again later.