Hello everyone!
I made an app which purpose is to make vacation request which works fine.
It has two fields where inside it has calendars and you can choose the start date (Fecha Inicio) and the end date (Fecha Fin) of your vacations request, also there is another field (Numero de Días) that displays the total numbers of days calculated from the calendar inputs (btw, this is the article i used to create the code https://powerapps.microsoft.com/hi-in/blog/excluding-weekends-and-holidays-in-date-differences-in-po...).
After filling the fields the app sends the data to a Sharepoint List, the only problem is it doesn't display the input from the field "Número de Días", the one that shows the number of days based off the calculation from the calendar inputs.
This is the code that i'm using on the OnChange properties from the Date fields
UpdateContext({actualiza:"No"});;
UpdateContext({numDias:RoundDown(DateDiff(DataCardValue13.SelectedDate; DataCardValue14.SelectedDate; Days)/ 7; 0)* 5 +
Mod(5 + Weekday(DataCardValue14.SelectedDate) - Weekday(DataCardValue13.SelectedDate); 5)});;
And this is the condition i'm using to validate the calculation on the Text property where the number of days appear
If(actualiza = "Si"; Parent.Default; If(actualiza = "No"; numDias))
How can i make that value appear on the SP list?
Thanks!
Solved! Go to Solution.
How did you add that DataCard? If you didn't go to Edit fields and then add that field from the list, then your datacard will NOT have the Update property.
ALSO - if you have made that datacard View only, it will also not have an Update property.
Please review your Update property for your Numero de Dias_DataCard3.
First, is the Field that is defined on it the 'Numero de Dias' field?
Second, what is the Update property of it?
You can skip all the variables and simply put the formula you have in the update property:
RoundDown(
DateDiff(
DataCardValue13.SelectedDate;
DataCardValue14.SelectedDate;
Days
)/ 7;
0
)* 5 + Mod(5 + Weekday(DataCardValue14.SelectedDate) - Weekday(DataCardValue13.SelectedDate); 5)
Since this number is calculated based on other datacard values, dealing with a default is not necessary, unless you want it displayed. If so, then just switch the above to the Default property of the datacard and then set the Update property to Value(DataCardValue17.Text)
I hope this is helpful for you.
I may need a little more info but here are a few things to look at:
Is the Update of Numero de Dias DataCard3 set to the correct field in your SP list?
Depending on the field in your SP list -does the formula return the correct data type - either Date or Text depending on the field?
Have you tried putting the If formula in the DataCard default instead of the "Value17" input?
Yes, the Field that is defined on it is the same as the 'Numero de Dias' field. Thanks for the reply i didn't think about the Update property but do i need to do some kind of configuration in order for 'Update' to appear on the screen? Because i can't find the Update property when selecting Numero de Dias_DataCard_3 in particular
How did you add that DataCard? If you didn't go to Edit fields and then add that field from the list, then your datacard will NOT have the Update property.
ALSO - if you have made that datacard View only, it will also not have an Update property.
I did have view only configuration, after that it worked. Thanks!
The first Microsoft-sponsored Power Platform Conference is coming in September. 100+ speakers, 150+ sessions, and what's new and next for Power Platform.
This training provides practical hands-on experience in creating Power Apps solutions in a full-day of instructor-led App creation workshop.
User | Count |
---|---|
182 | |
52 | |
41 | |
39 | |
33 |
User | Count |
---|---|
247 | |
80 | |
71 | |
70 | |
66 |