Ability for users to create their own functions with input parameters and output properties. This would allow users to streamline their code and make their apps much easier to maintain.
Proposal:
โDefineFunctionโ definition:
DefineFunction(FunctionName, [InputParameters], [OutputParameters], FunctionBody)
Creating a function:
DefineFunction( โAddRecordโ, [ID, RecordName], [ReturnStatus], UpdateContext({ new_Record: Patch([Items], Defaults([Items]), { Item_ID: ID, ItemName: RecordName }) }); If( IsBlank(new_Record), Notify(โUnable to add recordโ, NotificationType.Error); Set(ReturnStatus, โFailureโ), Notify(โSuccessfully added recordโ, NotificationType.Success); Set(ReturnStatus, โSuccessโ) ) )
Calling a custom function and accessing its return values:
If( AddRecord({ ID: 1, RecordName: โHamburgerโ }).ReturnStatus = โSuccessโ, Notify(โHappy Face!โ, NotificationType.Success) )
This is a relatively simple example but the benefits of encapsulating more complex, repeated operations in a function are pretty clear.