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.
NOTE: My normal response times will be Mon to Fri from 1 PM to 10 PM UTC (and lots of other times too!)
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
Super User

@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.
NOTE: My normal response times will be Mon to Fri from 1 PM to 10 PM UTC (and lots of other times too!)
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.
NOTE: My normal response times will be Mon to Fri from 1 PM to 10 PM UTC (and lots of other times too!)
Check out my PowerApps Videos too! And, follow me on Twitter @RandyHayes

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

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

Helpful resources

Announcements
Power Platform Conf 2022 768x460.jpg

Join us for Microsoft Power Platform Conference

The first Microsoft-sponsored Power Platform Conference is coming in September. 100+ speakers, 150+ sessions, and what's new and next for Power Platform.

May UG Leader Call Carousel 768x460.png

June User Group Leader Call

Join us on June 28 for our monthly User Group leader call!

PA Virtual Workshop Carousel 768x460.png

Register for a Free Workshop

This training provides practical hands-on experience in creating Power Apps solutions in a full-day of instructor-led App creation workshop.

PA.JPG

New Release Planning Portal (Preview)

Check out our new release planning portal, an interactive way to plan and prepare for upcoming features in Power Platform.

Top Solution Authors
Users online (1,380)