In my Power Apps app I have the following scenario:
in the list ParametroAtosJudiciais I have a column called PrazoDecorrenteAto and next to it another column called DiasUteis. Each Prazo (Deadline) has a corresponding DiaUtil (business day) (Example: the Deadline GENERATE THE INITIAL COSTS GUIDE has the value 15 in the business day column). Inside my app, I have a date selector field that should show the date corresponding to the following calculation: today's date + number of days defined when the user selects the Deadline (instantiated in the column DiasUteis) + 1. What is happening is the following: let's consider today 07/17/2023 (Monday); this code is not only bringing the days considered business days in the list DiasUteis, it implies that, if in the column DiasUteis of the list ParametroAtosJudiciais we have the value 15, the day that appears in the date selector field is 02/08/2023 (17/ 07/2023 + 15 days + 1) that is, the calculation is considering all days, even those that are not classified as business days, and the correct date should be 07/08/2023 (07/17/2023 + 15 business days + 1). Currently, the code that is in the DefaultDate property of the date picker field is:
if(
LookUp(
ParameterJudicial Acts;
TermDecurrentAto = cmbAdvogadoRedatorVisualizacaoProcesso_5.Selected.Value;
aux
) <> 1 && LookUp(UseDays; Date >= dtPublicacaoVisualizacaoProcesso.SelectedDate).UtilDay = "Yes";
DateAdd(
dtDataPublicacaoVisualizacaoProcesso.SelectedDate;
LookUp(
ParameterJudicial Acts;
TermDecurrentAto = cmbAdvogadoRedatorVisualizacaoProcesso_5.Selected.Value).DaysWorking
+ 1
;TimeUnit.Days)
)
I don't know if I made myself clear, but we have the COLUMN DiasUteis in the list ParametroAtosJudiciais and the LIST DiasUteis, which is like a calendar containing two columns, one with the dates and the other with the text YES or NO to classify the date as a working day or not

Report
All responses (
Answers (