cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Advocate II
Advocate II

Patch two types of data to a single SharePoint List

Hello!

 

I was wondering if it is possible to patch both a DatePicker data that the user chooses and a text input where I want the user to introduce the data to the same SP list?

 

I am trying to do something like in the first photo, I tried putting the time in a list but then it didn't work properly so then I thought about combining the DatePicker and TextInput but it doesn't allow me to do so saying that data in LookUp cannot be found.

 

Any ideas would be appreciated. Thank you!

3 REPLIES 3
Community Support
Community Support

Hi@abah,

Based on the issue that you mentioned, do you want to patch a date and time value to the SP list?

Could you please share a bit more about the 'From' and 'To' column type, are they all Date and Time(If so, please specify if time is included)?

Actually, if the 'From' and 'To' column are all Date and Time column, you could not patch the DatePicker selected date and TextInput entry to the single column. They are totally two different data type.

As an alternative solution, I think you could create a Date and time column within your SP list and make it include the time.

22.png

And in your form, please insert two Dropdowns as the TimePicker in a same data card.

Set the Items property of the HourPicker as below:

 

 

["00","01","02","03","04","05","06","07","08","09","10","11","12","13","14","15","16","17","18","19","20","21","22","23"]

 

 

Set the Items property of the MinutePicker as below:

 

 

["00","01","02","03","04","05","06","07","08","09","10","11","12","13","14","15","16","17","18","19","20","21","22","23","24","25","26","27","28","29","30","31","32","33","34","35","36","37","38","39","40","41","42","43","44","45","46","47","48","49","50","51","52","53","54","55","56","57","58","59"]

 

 

Set the OnSelect property of the Button as below:

 

 

Patch(
    ClassSubmission,
    Defaults(ClassSubmission),
    {
        From: DateValue2.SelectedDate + Time(
            Value(HourValue2.Selected.Value),
            Value(MinuteValue2.Selected.Value),
            0
        ),
        To: DateValue3.SelectedDate + Time(
            Value(HourValue3.Selected.Value),
            Value(MinuteValue3.Selected.Value),
            0
        )
    }
)

 

 

112501Gif.gif

Hope it could help.

Best Regards,

Qi

Thank you very much for your reply and for the solution! I will try it out. The only problem is that I tried working with a list in an earlier version, and in the next screen I have a Gallery of Seats where I want the user to select a seat and the seat to become red when chosen, based on the date and time and the code for that didn't work with a list or with two different items *DatePicker and TextInput and so on. It only worked when I had DatePicker only or TextInput only.

So this is how it looks when I try to connect it with my seats from another screen. The SP list has DateTime Value with Time included but I don't know where the problem might be...

seatstime1.jpg

 

Helpful resources

Announcements
News & Announcements

Community Blog

Stay up tp date on the latest blogs and activities in the community News & Announcements.

Power Apps Community Call

Power Apps Community Call- January

Mark your calendars and join us for the next Power Apps Community Call on January 20th, 8a PST

PP Bootcamp Carousel

Global Power Platform Bootcamp

Dive into the Power Platform stack with hands-on sessions and labs, virtually delivered to you by experts and community leaders.

secondImage

Power Platform Community Conference On Demand

Watch Nick Doelman's session from the 2020 Power Platform Community Conference on demand!

Top Solution Authors
Top Kudoed Authors
Users online (7,251)