cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
AlexVargaz
Frequent Visitor

App working but not passing data to Sharepoint list

Hello everyone!

 

I made an app which purpose is to make vacation request which works fine.

 

app.png

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...).

 

appnum.png

 

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.

 

columna vacia.png

 

 

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))

 

 

valores.png

How can i make that value appear on the SP list?

 

Thanks!

1 ACCEPTED SOLUTION

Accepted Solutions

 

@AlexVargaz 

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.

 

 

_____________________________________________________________________________________
Digging it? - Click on the Thumbs Up below. Solved your problem? - Click on Accept as Solution below. Others seeking the same answers will be happy you did.
Check out my PowerApps Videos too! And, follow me on Twitter @RandyHayes

Really want to show your appreciation? Buy Me A Cup Of Coffee!

View solution in original post

5 REPLIES 5
RandyHayes
Super User III
Super User III

@AlexVargaz 

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.

_____________________________________________________________________________________
Digging it? - Click on the Thumbs Up below. Solved your problem? - Click on Accept as Solution below. Others seeking the same answers will be happy you did.
Check out my PowerApps Videos too! And, follow me on Twitter @RandyHayes

Really want to show your appreciation? Buy Me A Cup Of Coffee!
BrianS
Super User
Super User

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

 

update.png

 

 

 

@AlexVargaz 

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.

 

 

_____________________________________________________________________________________
Digging it? - Click on the Thumbs Up below. Solved your problem? - Click on Accept as Solution below. Others seeking the same answers will be happy you did.
Check out my PowerApps Videos too! And, follow me on Twitter @RandyHayes

Really want to show your appreciation? Buy Me A Cup Of Coffee!

View solution in original post

I did have view only configuration, after that it worked. Thanks!

Helpful resources

Announcements
PA_User Group Leader_768x460.jpg

Manage your user group events

Check out the News & Announcements to learn more.

Power Query PA Forum 768x460.png

Check it out!

Did you know that you can visit the Power Query Forum in Power BI and now Power Apps

Carousel 2021 Release Wave 2 Plan 768x460.jpg

2021 Release Wave 2 Plan

Power Platform release plan for the 2021 release wave 2 describes all new features releasing from October 2021 through March 2022.

R2 (Green) 768 x 460px.png

Microsoft Dynamics 365 & Power Platform User Professionals

DynamicsCon is a FREE, 4 half-day virtual learning experience for 11,000+ Microsoft Business Application users and professionals.

Users online (1,986)