State Actions
  • 03 Jun 2022
  • 1 Minute to read
  • Dark
    Light

State Actions

  • Dark
    Light

Article Summary

getState

Retrieves just one State.

Property

Value

Description

id*

string

The ID of the State

getAllStates

state = saveState({"name": "State 1", "code": 123456
state = getState(state.id)

Retrieves all States. If there are no existing states in the system, RapidIdentity will create one using a createState action set.

Property

Value

Description

pageSize

integer

The page size (required for a paging request)

pageNum

integer

The page number (defaults to 1 for a paging request)

states = getAllStates()
stateId = " "
if (states.length) < 1) {
state = saveState({"name": "State 1", "code": 123456
stateID = state.id
} else {
stateId = states[0].id
state = getState(stateID)

saveState

Updates a State.

Property

Value

Description

id*

string

The ID of the State

idautoStateRec = createRecord(false)
addRecordFieldValue(idautoStateRec, 'name', stateName, false)
addRecordFieldValue(idautoStateRec, "code", stateCode, false)
idautoState = saveState(idautoStateRec)
return idautoState

getStateRelationship

Retrieves just one State relationship.

Property

Value

Description

stateid*

string

The state ID of the State relationship

user_id

expression

The user ID for the state relationships to retrieve

role

string

The role of the state relationships to retrieve

stateRel = getStateRelationship(stateId, user_id)
stateRelId = " "
if stateRel.length < 1) {
stateRel = savestateRelationship({"stateId": state.id, "userId": user_id, "role": ADMINISTRATOR
} else {
stateRelID = stateRel[0].id
stateRel = getStateRelationship(stateRelId)
}

getAllStateRelationships

Retrieves all State Relationships. If there are no state relationships currently in the system, RapidIdentity will create one using a createStateRelationship action set.

Property

Value

Description

stateId

string

The ID for which to fetch state relationships

userId

string

The user ID for which to fetch state relationships

role

string

The role for which to fetch state relationships

pageSize

integer

The page size (required for a paging request)

pageNum

integer

The page number (defaults to 1 for a paging request)

stateRels = getStateRelationships(stateId, user_id)
stateRelId = " "
if stateRels.length < 1) {
stateRel = savestateRelationship({"stateId": state.id, "userId": user_id, "role": ADMINISTRATOR
} else {
stateRelID = stateRel[0].id
stateRel = getStateRelationship(stateRelId)
}

saveStateRelationship

Updates a State Relationship.

Property

Value

Description

stateId

string

The ID for which to fetch state relationships

userId

string

The user ID for which to fetch state relationships

role

string

The role for which to fetch state relationships

pageSize

integer

The page size (required for a paging request)

pageNum

integer

The page number (defaults to 1 for a paging request)

state = saveState({"name": "State 1", "code": 123456
stateRel = savestateRelationship({"stateId": state.id, "userId": user_id, "role": ADMINISTRATOR
stateRel = getStateRelationship(stateRel.id)

deleteStateRelationship

Deletes a State Relationship.

Property

Value

Description

id*

string

The ID of the State Relationship

Delete by State Relationship id.

deleteState

Deletes a State.

Property

Value

Description

id*

string

The ID of the State

Delete by State id.


Was this article helpful?