Functions
This section provides information about the functions that are supported within card definitions.
Use the functions to link cards to event handlers, execute operations to fetch data, validate data input, navigate between cards, and manage other interactions.
Fetching data
Function.SOLVE.getTokenBalance
Fetches the available SOLVE token balance after joining a network.
Parameter
name
string
The name of the function: Function.SOLVE.getTokenBalance
sourceKeys
array
Not required
totalKey
string
Not required
resultKey
string
The key name in which you want to store the final outcome of the function.
Function.SOLVE.getExchangeRate
Fetches the exchange value of SOLVE from USD.
Parameter
name
string
The name of the function: Function.SOLVE.getExchangeRate
sourceKeys
array
The key name, which has a value in USD and is passed as an input to the function.
resultKey
string
The key name in which you want to store the final outcome of the function.
Function.Profile.key
Shows user profile data inside the network.
Parameter
text
string
The name of the function: Function.Profile.key
The following keys can be used as input:
name (nickname)
cw_id
phone
country (get user's country code, such as "US")
first_name
last_name
ssn
language
Function.PROTOCOL.preLoadData
Executes a GET request to the user node.
Parameter
name
string
The name of the function: Function.PROTOCOL.preLoadData
url
string
The URL path where the data is stored.
Function.getGPSLocation
Fetches user's current location latitude and longitude.
Parameter
name
string
The name of the function: Function.getGPSLocation
sourceKeys
array
The key names that correspond to the user's location coordinates (latitude and longitude).
Function.Preference.language
Shows user preference data such as language preference.
Parameter
text
string
The name of the function: Function.Preference.language
This function is used only inside Tiles.
Performing calculations
Function.data.totalCount
Shows the total count of fetched data.
Parameter
text
string
The name of the function: Function.data.totalCount
Function.calculateSum
Calculates the total sum of all input value.
Parameter
name
string
The name of the function: Function.calculateSum
sourceKeys
array
The names of the keys on which you want to calculate the sum.
resultKey
string
The key name in which you want to store the final outcome of the function.
NAVIGATE
string
The value of the card ID where you want to navigate after getting the result from the function. If you want to show results on the same card, then use the same card ID.
Function.calculateSubtract
Calculates the subtraction of the input value.
Parameter
name
string
The name of the function: Function.calculateSubtract
sourceKey
string
The key name that you want to subtract from the totalKey.
totalKey
string
The key name from which the source key value gets subtracted.
resultKey
string
The key name in which you want to store the final outcome of the function.
NAVIGATE
string
The value of the card ID where you want to navigate after getting the result from the function. If you want to show results on the same card, then use the same card ID.
Function.calculateMultiply
Calculates the multiplication of all input values.
Parameter
name
string
The name of the function: Function.calculateMultiply
sourceKeys
array
The key names on which you want to calculate multiplication.
resultKey
string
The key name in which you want to store the final outcome of the function.
NAVIGATE
string
The value of the card ID where you want to navigate after getting the result from the function. If you want to show results on the same card, then use the same card ID.
Function.calculateDivide
Calculates the division of the input value.
Parameter
name
string
The name of the function: Function.calculateDivision
sourceKey
string
The key name that you want to get divided from the totalKey.
totalKey
string
The key name from which the source key value gets divided.
resultKey
string
The key name in which you want to store the final outcome of the function.
Function.calculatePercentage
Calculates the percentage of the input value.
Parameter
name
string
The name of the function: Function.calculatePercentage
sourceKey
string
The key name that has the percentage value, like 10% should be used as 10, 20% should be used as 20.
totalKey
string
The key name on which sourceKey will be applied. For example, if sourceKey has a key name with a value of 10 and totalKey has a key name with a total value of 200, the outcome will be 10 * 200 / 100 = 20.
resultKey
string
The key name on which the final outcome of the function is stored.
NAVIGATE
string
The value of the card ID where you want to navigate after getting the result from the function. If you want to show results on the same card, then use the same card ID.
Validating data input
Function.validateReferralCode
Validates if the referral code entered is a valid TuumIO Wallet ID.
Parameter
name
string
The name of the function: Function.validateReferralCode
resultKey
string
The input key for referral code. For example: {$ReferralCode}
Check field format and field value
Validates field format and value. This function is used in SmartTile1.
Parameter
fieldFormat
string
The name of the field value to be validated. The supported fieldFormat values are:
age
email
pin
year
date
phone
country
ssn
otp
text
number
trialId
min
string
The minimum length of the field value.
max
string
The maximum length of the field value.
validation
string
The validation whether field is required and the error message.
name
string
The validation whether field is required.
error
string
The error message that shows when the value entered in invalid.
Linking and navigation
Function.When.Condition.Navigate
Shows a default empty card when no data is fetched, otherwise it moves to a specific card based on the whenConditionKey
value within the data. This function allows displaying different cards based on various conditions.
Parameter
name
string
The name of the function: Function.When.Condition.preLoad
method
string
The method used to fetch data: GET
url
string
The path of the transaction data collection.
cardId
string
The reference ID of the current card.
whenConditionKey
string
The key name which represents the condition values, such as recordStatus
.
whenConditions
array
The list of condition values and card IDs.
conditionValue
string
The value of the condition.
conditionCardId
string
The card ID reference of the destination card.
Function.When.Condition.PreLoad
Shows a default empty card when no data is fetched, otherwise it stays on the current card. For the description of parameters, see Function.When.Condition.Navigate.
Function.Navigate
Moves to the destination card without calling events or event handlers. This function also supports calculating and comparing values.
Parameter
name
string
The name of the function: Function.Navigate
cardId
string
The card ID reference of the destination card.
Function.ChangeCard
Pushes to a new view after comparing the compareKey values.
Parameter
name
string
The name of the function: Function.ChangeCard
compareKey
string
The dynamic value based on results from another function.
compareValue
integer
The fixed value to which the compareKey value is compared to.
cardIdForGreaterValue
string
The card ID that is viewed when the compareKey value is greater than the fixed value set in compareValue.
cardIdForLessValue
string
The card ID that is viewed when the compareKey value is less than the fixed value set in compareValue.
cardId
string
The card ID of the current view.
Function.deposit.SOLVE
Navigates from any card to the "SOLVE" tab view.
Parameter
uiAction
string
The name of the function: Function.deposit.SOLVE
Multiple selection
Allows multiple item selection for Tile12: Dropdown Option Selector.
Parameter
fieldFormat
string
The value that allows selecting multiple items in a dropdown list.
isLink or isUrl
Adds links inside the text of a tile, such as Tile0: Text Label.
Parameter
isLink or isURL
string
To enable the link features in a tile, the value is set to "true"
.
urls
array
The list of labels and URLs. If isLink or isURL is set to "true", then this property is required.
label
string
The title or subtitle text that will be clickable from the tile.
url
string
The URL that opens when the label text is clicked.
Function.CallEventHandler
Executes other functions to pass user input to the next card.
Parameter
name
string
The name of the function: Function.CallEventHandler
method
string
The user input data to pass to the next card.
Function.COPY.TEXT
Copies the subtitle or title text from specific tiles.
Parameter
uiAction
string
The name of the function: Function.COPY.TEXT
Function.camera_selfie
Captures a selfie or selects from the gallery.
Parameter
name
string
The name of the function: Function.camera_selfie
resultKey
string
The key name which will save the image in base64 format and will be added to the payload to be sent to the node.
Function.uploadFiles
Uploads multiple files in AttachmentUploadTile
.
Parameter
name
string
The name of the function: Function.uploadFiles
sourceKeys
array
The input key of the AttachmentUploadTile. For example, for input key {$attachingFiles}
, the value for sourceKey is "attachingFiles".
resultKey
string
The final submit key for storing data.
timestampKey
string
The time in milliseconds when the file is successfully uploaded.
Last updated