Cast Values To Different Data Types Exercise
Cast Values To Different Data Types Exercise
Exercise
Advanced Expressions
Introduction 2
How to Complete the Exercises in this Tutorial 2
How Can I Practice? 2
Appian Version 2
Naming Conventions 2
Save Often 3
Additional Resources 3
Practice 1 Set Up: Cast Values to Different Data Types 4
Practice 1 Help and Resources: Cast Values to Different Data Types 8
Casting Results 8
Notice of Rights
This document was created by Appian Corporation, 7950 Jones Branch Dr, Tysons, Virginia 22102.
Copyright 2024 by Appian Corporation. All rights reserved. Information in this document is subject to
change. No part of this document may be reproduced or transmitted in any form by any means, without
prior written permission of Appian Corporation. For more information on obtaining permission for
reprints or excerpts, contact Appian Training at [email protected].
Keep in mind that this is a community environment not suitable for production workloads or
sensitive information.
Appian Version
Appian Community Edition is on the latest Appian version. If you are following the exercises
from a previous Appian version, go to academy.appian.com to download the latest version.
Naming Conventions
When you register for Appian Community Edition, you gain access to a workspace, which is
your personal area within the community environment. When your workspace has been
assigned, you will receive a confirmation email with a workspace ID.
Use this workspace ID when creating new applications and objects. Otherwise, you could run
into naming conflicts with objects created by other users. Pre-loaded apps in your workspace
also include the workspace ID. In the example below, the application prefix for the Acme
Auto Solution app is W0000AS. So, the workspace identifier is W0000, which would be
included in any new app’s prefix.
24.3
Additional Resources
Appian provides a number of training resources for Appian developers. The following
resources are particularly popular with our learners:
● Academy Online - Appian’s online courses provide useful survey courses, step-by-step
tutorials, and practice exercises. Explore these resources at your own pace. Survey
courses will help you develop a better grasp of the topics you need to learn. Video
and print tutorials will help you with getting hands-on experience with Appian.
● Community Discussions for New Users - Check out the New to Appian thread in
Community. Join our community of experts to ask questions and find answers from
past discussions.
24.3
a!localVariables(
/*Convert to Text*/
/*Convert to Boolean*/
local!integer: 100,
/*Cast to Text*/
local!array: {100,200},
/*Cast to Map*/
/*Convert to Integer*/
local!boolean: true,
/*Cast to User*/
24.3
},
Tip
Be sure to copy the entire expression, including the last parenthesis and the
empty brackets.
24.3
4. Starting on Line 22, enter the conversion function or cast() function to convert each
variable.
● For example, the first expression, which converts local!integer to a text string
is shown in the following figure.
● Hint: use the cast() function for variables where the instruction uses the word
“cast”; use conversion functions for the other variables
● Reference the Appian docs page for conversion functions to help you complete
the exercise
5. Click Test Rule as you go to verify you’ve chosen the correct function and configured it
correctly.
24.3
24.3
Casting Results
1. Cast each of the 6 examples
2. Cast the entire array of cast values to a map
3. If you still need help, copy and paste the following expression into the editor:
a!localVariables(
/*Convert to Text*/
/*Convert to Boolean*/
local!integer: 100,
/*Cast to Text*/
24.3
/*Cast to Map*/
/*Convert to Integer*/
local!boolean: true,
local!date: {"1/10/21","2/20/20"},
/*Cast to User*/
local!user: "admin.user",
/*Answer Key*/
cast('type!{http://www.appian.com/ae/types/2009}Map',
string: tostring(local!integer),
boolean: toboolean(local!integer),
dictToMap: cast(typeof(a!map()),local!dictionary),
arrayToString: tostring(local!array),
booleanToInteger: tointeger(local!boolean),
date:todate(local!date),
dateUsingCast:
cast('type!{http://www.appian.com/ae/types/2009}Date',local!date),
24.3
24.3