5 Most common SAIL functions that is useful for building an end-to-end application

Hi Sail Wizards out there,

I am finding it increasingly vital to be able to use functions in Appian. Apart from things the if(), index(), cast() ect...

What are some of your favourite functions and why? Ones that are less well known would be great.

A list of 3-5 would be awesome. Happy to do the learning/reading up but I first need to know about the funxtions! 

Many thanks, 

Eric

  Discussion posts and replies are publicly visible

  • I don't believe in favorites. They're all beautiful and unique in their own ways.

     

    I would recommend reviewing the documentation for each of them here. There aren't too many. Additionally, you can find helpful information in the function recipes, query recipes, and interface recipes documentation.

  • I think some of the other loop functions are under used.  A lot of times I see most developers gravitate towards apply().  filter() is a nice function that can simplify code.

  • 0
    Certified Lead Developer
    a!forEach() Quite possibly the single greatest individual improvement to Appian since SAIL was released

    exact() This essentially replaces the = operator, but in a way that you can use as the expression of a looping function. It also implicitly casts any datatype as a string so you can use it to compare say DateTime objects to one another or compare across types as it will be rendered when displayed. exact() is almost like JavaScript ==

    enumerate() Exceptionally useful in so many scenarios

    fixed() Absolutely vital for having large decimal values display with proper precision (large amounts of sig. figs. on either side of the decimal point)

    type! I have to mention the uncanny usefulness of the type constructor. This allows you to create test data for expression rules and SAIL forms, it's the only way you can change the value of one CDT out of an array of CDT [ ri!updateArray(arrayOfCDT, ri!myIndex, rule!ruleThat'sJustATypeConstructor(index(ri!arrayOfCDT, ri!myIndex))

    index() / property() These are technically aliases of each other, with index() being the more powerful one; no one uses property() but they should. property() returns the named property of a CDT, such as "firstName". Index returns the value at a specified point in a list, such as the 5th one, but also does the named properties. It allows for default values if it can't be found, it's less brittle than dot notation or bracket notation, and it's the only way in the world you're going to index from an indexed list (you need to get the 5th "firstName") You should expect to use index() every day
  • 0
    Certified Lead Developer
    in reply to Dave Lewis
    > no one uses property() but they should.

    Agreed and this bugs me a lot. For clarity of code I have set as my own personal 'best practice' to ALWAYS use property() when retrieving a dot property and index() when retrieving an array position - I also try to drill this into my new trainees and other members of my teams when it's code review time. Always using index() for both leads to nothing but confusion when you get to more complex cases i.e. trying to retrieve a particular property from a particular position in an array, etc.
  • 0
    Certified Lead Developer
    Hi It all depends upon the requirement, and based on requirements we need to use various functions.

    Hence it's very difficult to call few of them as useful / favorite.

    Instead i would recommend you to go through the Function & Interface recipes.
  • HI erics,

    It depends on what requirement you are working on.
    please find the link docs.appian.com/.../Function_Recipes.html

    Thanks,
    ravalik
  • 0
    Certified Lead Developer
    If you're looking for SAIL specific:

    1. Rich Text - Especially with the most recent improvements made, you can now do so many impressive things with this. You can mimic validations, but in yellow with the user still being able to submit, you can dynamically add icons, you can make them links, make an entire list of tabs out of only 1 rich text, you have access to the full suite of Unicode including emojis that render in full color on Chrome, there's just a world of opportunity for outside the box functionality

    2. Image Components - This can actually allow you to create custom controls and do things otherwise inconceivable in Appian without them. Don't like the buttons that come with Appian? use Image to make your own. Radio buttons aren't flashy enough? use Images to create your own. Want animated spinning text? Image supports animated gif files. Want graphical Icons in a grid? That's one of the most standard uses of Image. You can also upload your own icons to use in place of or augment the ones that come out of the box.

    3. Card Layouts - A brand new component that I'm sure hasn't had it's full potential even dreamed of yet. If you set an array of card layouts to default to green squares, clickable, and either green squares with a white or black circle upon click, that could become the game Othello in Appian. You could probably build a decent chess game with an array of card layouts.

    4. Billboard Layout: By setting the column to center, wide, and transparent, you can marry the graphics of components on top of the Billboard Layout seamlessly with the graphic of the billboard itself. Along with dynamically changing which image is shown, this could open us up to all manner of thoroughly un-Appian-like interfaces.
  • We are just upgrading from 7.11 to 18.4 and are finding writetodatastore, deletefromdatastore, and decision objects to be super useful. They have simplified our process models and made the user experience much more seemless.