REFERRING USER PROFILE ATTRIBUTES IN A FORM


While creating users accounts in User Management connector, some profile related information is stored in the system. Below we have illustrated how you can consume this information in the  form.


To show Display Name in a form:

Expression: Login.DisplayName


To show email address in a form:

Expression: Login.Email 


To show login ID in a form:

Expression: Login.LoginID


To show Department in a form:

Expression: Login.Department




GENERATING A UNIQUE ID OFFLINE


Many times we need to assign a unique identity to a form being submitted through makeen transform. Since makeen transform can work in offline mode as well, and generating a unique identity which remains unique for all records submitted by all users can turn out to be a tricky job. We recommend following expressions to meet this requirement:



Login.LoginID+"_"+Now().Day+""+Now().Month+""+Now().Year+""+Now().Hour+""+Now().Minute+""+Now().Second



This expression would generate a sequence number similar to this: 

michael.edward_10122019124823



TO FIND TEXT IN  MULTI SELECT SEGMENTED CONTROL OUTPUT


Segmented control is among the key controls that shape great user experience in transform apps. While working with a multi-select segmented control you may need to configure some rules based on the selection a user would make through a segmented control. 


Below expression helps you find a given text against the selection outcome of a segmented control.



Contains(Controls["segDepartments"].SelectedValues, "Logistics")



USING MULTI SELECT SEGMENTED CONTROL AS RECIPIENTS LIST


At the time of submitting a form, you may want to present a list of recipients to the user to who the email notification shall be sent to. This list can be easily created using  a segmented control.



Following expression can be used to extract semicolon separated email addresses from the segmented control output.


Concat(";",Controls["segEmailCopyTo"].SelectedValues)



CALCULATING DIFFERENCE BETWEEN DATE & TIME


In order to record duration of an activity, usually start and end time are recorded in the app, and the difference between two points in time is calculated. It is depicted in the snapshot below:




Following expression can help you calculate the interval in the above scenario.



Math_Round((ToDate(Controls["dpActivityEndDate"].Date.ToString().Split(" ")[0]+" "+Controls["tpActivityEndTime"].Time.ToString())-ToDate(Controls["dpActivityStartDate"].Date.ToString().Split(" ")[0]+" "+Controls["tpActivityStartTime"].Time.ToString())).TotalMinutes, 0)



SORTING RECORDS IN A REPEATER CONTROL


In makeen transform Repeater control is a multipurpose UI element that is used in many ways. One of the major uses is to list records on a page from a database. You can apply various types of sorting on the  records listed under a repeater control. Here we have mentioned an example where records are sorted in reverse chronological order with respect to time stamp..



Entity["notes"].FindAll((["ComponentID"]+"")=Controls["ComponentID"].Text & (["ProjectID"]+"")=Controls["ProjectID"].Text).OrderBy(["TimeStamp"] desc)



STORING DEVICE ID WITH FORM


In order to keep complete track of a record, sometimes it is required to store device unique identity along with the forms data submitted through that device. This can be achieved through following expression.



Device.DeviceID



RECORDING FORM VERSION FOR AUDIT CONTROL


For version is an important piece of information especially for troubleshooting purposes. Here is how you can capture form verison.



PageDO.Version


RECORDING FORM NAME


Likewise you can record Form Name along with the rest of the data. 


PageDO.PageTitle


RECORDING APP NAME


If needed, app name can also be recorded through this expression.


PageDO.PageTitle





FUNCTIONS


Below you can find a detailed list of functions that you can apply while writing an expression.


GENERAL PURPOSE FUNCTION


  1. Find

  2. FindAll

  3. Limit

  4. Exists

  5. GroupBy

  6. GroupByNamed

  7. Select

  8. SelectNamed

  9. OrderBy

  10. Switch

  11. IsDate

  12. IsToday

  13. AddPeriod

  14. ToUtc

  15. ToLocalTime

  16. Percent

  17. Bool

  18. Join

  19. FullJoin

  20. InnerJoin

  21. LeftJoin

  22. RightJoin

  23. ToList

  24. ToDictionary

  25. ToDate

  26. Coalesce

  27. ToObject

  28. ToObjectList

  29. Now

  30. UtcNow

  31. Substring

  32. Replace

  33. Split

  34. ToUpper

  35. ToLower

  36. ToNumber

  37. ToString

  38. Format

  39. Concat

  40. ConcatNonEmpty

  41. Contains

  42. RegexReplace

  43. RegexpReplace

  44. Matches


MATH FUNCTIONS

  1. Math_Abs

  2. Math_Acos

  3. Math_Asin

  4. Math_Atan

  5. Math_Atan2

  6. Math_Cos

  7. Math_Cosh

  8. Math_Exp

  9. Math_Log

  10. Math_Max

  11. Math_Min

  12. Math_Pow

  13. Math_Round

  14. Math_Sin

  15. Math_Sinh

  16. Math_Sqrt

  17. Math_Sum

  18. Math_Tan

  19. Math_Tanh

  20. Math_Pi

  21. Eval


TIME FUNCTIONS


  1. AddPeriod(1, 'day')

  2. AddPeriod(1, 'days')

  3. AddPeriod(1, 'hour')

  4. AddPeriod(1, 'hours')

  5. AddPeriod(1, 'ms')

  6. AddPeriod(1, 'millis')

  7. AddPeriod(1, 'millisecond')

  8. AddPeriod(1, 'milliseconds')

  9. AddPeriod(1, 'min')

  10. AddPeriod(1, 'mins')

  11. AddPeriod(1, 'minute')

  12. AddPeriod(1, 'minutes')

  13. AddPeriod(1, 'month')

  14. AddPeriod(1, 'months')

  15. AddPeriod(1, 'sec')

  16. AddPeriod(1, 'secs')

  17. AddPeriod(1, 'second')

  18. AddPeriod(1, 'seconds')

  19. AddPeriod(1, 'tick')

  20. AddPeriod(1, 'ticks')

  21. AddPeriod(1, 'year')

  22. AddPeriod(1, 'years')

  23. AddPeriod(1, 'week')

  24. AddPeriod(1, 'weeks')