Good morning!
Hello my friends. I’m having a problem with appgyver that I imagine is something trivial for you. In my form I have a date field and I have a component for it (date field). In my table and in the variable the field type is like DATA/TIME. I would like to record the date in my bank like this DD.MM.YYYY. But all the ways I tried I can’t save, not even using the documentation formula. It’s definitely something I’m missing out on. If any friend can help me I would appreciate it. I’ve been looking for this solution for 1 week.
Fala Claudio,
Cara, pela minha experiencia, não da pra usar formula de formatação enquanto você edita ou escreve uma informação no input, mas você pode alterar e formatar ela no “onBlur”
Vincula o input a uma variável de data igual você fez, e no “onBlur” você faz a formatação, vou botar uns prints aqui de exemplo.
Criei uma variavel Date/Time igual você fez:
Nesse print foi o que falei, não da pra formatar direto o valor do input
Aqui no input eu vinculei a variável Date/Time e no flow function “onBlur” eu altero a variável data com ela mesma mas formatando da forma que você quer
Aqui ele da erro mas quando você rodar a aplicação vai funcionar numa boa!
Espero ter ajudado!
Boa tarde!
Olá meu amigo.
Vou testar a sua solução aqui. Para usar um componente de data não daria né ?
Mas mesmo assim agradeço pela ajuda.
Se eu entendi bem, você quer salvar com esta formatação “DD.MM.YYYY”, mas a formatação é para exibição, apenas. Na base de dados, se o campo é do tipo Datetime, ele sempre vai salvar com o formato padrão. Use a fórmula para exibir os dados ao usuário da maneira como desejar. O mesmo vale para valores monetários, você pode salvar como Number e na hora de exibir faz a formatação com FORMAT_LOCALIZED_DECIMAL;
Obrigado meus amigos. Um final de semana abençoado a todos.
Claudio, your friends above are right. You should record your data as a DateTime, in the datetime default format, it’s the best practice. that way you can sort by date easily while making a query, which would not be possible in the DD.MM.YYYY number format. It’s not something that should be done.
On the contrary, it’s on the display level on the page that you format your datetime as DD.MM.YYYY if you want to.
(Or maybe explain why it’s important for your case to record as DD.MM.YYYY?)