cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Keit
Regular Visitor

Patching or updating dates

Hi

 

basically i need to check if the date from sharepoint column(ReservedForTomorrow) is equal to todays date and if it is then copy/ that date to other column called ReservedFor. current code that doesn't run

Patch(Filter('Parking - Products'; StartsWith(Text(ReservedForTomorrow); Datenow)); {ReservedFor:Today()+23})

DateNow is a variable with todays date

i'm not a proffesional in this area and have been trying to fix it for days 😞

1 ACCEPTED SOLUTION

Accepted Solutions

@Keit While patching, one column can't refer to a value from another column in the SP list. You have to supply the value. If you don't have this value in the APP, you can use the record that the 1st patch returns and then do another patch with the value that's in it.

Set(patchedRecord, Patch('Parking - Products'; LookUp('Parking - Products'; ReservedForTomorrow=Today()); {ReservedFor:Today()}));
Patch('Parking - Products'; patchedRecord; reservedbytomorrow:patchedRecord.reservedby})

 

View solution in original post

14 REPLIES 14
CNT
Super User
Super User

@Keit Try this,

Patch('Parking - Products', LookUp('Parking - Products', ReservedForTomorrow=Today()), {ReservedFor:Today()+23})

 

Keit
Regular Visitor

sadly that didn't update that reservedfor 

@Keit what datatypes are ReservedForTomorrow & ReservedFor?

 

Keit
Regular Visitor

date and time 

Keit_0-1621511340312.png

 

@Keit Try setting it to Date Only

CNT_0-1621511554070.png

 

Keit
Regular Visitor

Thanks this worked, had to change the date codes on all screens.

another question how would i be able to patch text columns that conatin emails too, code that i tried below didn't accept it

Patch('Parking - Products', LookUp('Parking - Products', ReservedForTomorrow=Today()), {ReservedFor:Today()};{reservedbytomorrow:reservedby})

 

@Keit when you want to patch multiple fields, separate them with a comma,

Patch('Parking - Products', LookUp('Parking - Products', ReservedForTomorrow=Today()), {ReservedFor:Today(), reservedbytomorrow:reservedby})

Please remember to give a 👍 and accept the solution as it will help others in the future.

 

Keit
Regular Visitor

the last one only lets me choose datacards not the column value

@Keit I'm not quite sure what you mean by that. If you have a TextInput that has the email, you will have to write, my TextInput.Text

Hope that helps. 

Helpful resources

Announcements
Power Apps News & Annoucements carousel

Power Apps News & Announcements

Keep up to date with current events and community announcements in the Power Apps community.

Power Apps Community Blog Carousel

Power Apps Community Blog

Check out the latest Community Blog from the community!

Top Solution Authors
Top Kudoed Authors
Users online (3,897)