36
Views
5
Comments
(beginner) how format Input Widget to currency and date - steps

Hello!

I am beginner and need help and learn the steps to do:

I am using Traditional Web in OutSystems 11.

1 _ For date, I have an Entity with the Attribute date type and I am using it on a Detail Screen with the Input Widget to insert a Date, and on the List Screen to show that date. But, I want show only the year. It is Not the full date.

2 _ So, for a date yet, I Maybe need to change the type of Attribute to Integer. But if I do this, it will be need set the Input Widget to accept only 4 characters.

3 _ For currency, I have an Entity with Integer Attribute and I am using this on a Detail Screen with the Input Widget to enter a price, and on the List Screen to show that price. So, I want show this in the format of Currency and limited characters.

It seems to me, that set this configuration is different in the details screen (when the user enters the data) and the List screen (when the data is shown).

I thank you in advance for your help, and please show me the steps for that.

Thanks

mvp_badge
MVP
Rank: #78

Hi Christian,

For such use-case, there exists a lot of pre-defined functions available to use, which you can call/use within the Expression editor widget

Refer this: OutSytems Expression Editor | Built-in Functions


1) To show only the year from the date value, you can use the

Syntax: Year(Date)

Year(CurrDate())


Syntax: FormatDatetime(Date, "requiredFormat")

FormatDateTime(CurrDate(), "yyyy")


2) To format the currency value, you can use

FormatCurrency(value, symbol, decimal_digits, decimal_separator, group_separtor)

Hope this helps you!


Kind regards,

Benjith Sam

Rank: #173

Hi Christian, 

a tip, you can check out the functions and examples of what they do right in the service studio:


And if you need, always take a look at the dependencies, sometimes some functions are there.

Most can generally be used in input fields, expressions and flows.


Regards.