cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Bub
Helper I
Helper I

Populate Datepicker from Variable

Greetings,

 

I have a date saved into a sharepoint list text column as dd/mm/yyyy. It got there as a patch from powerapps from a datepicker selection like this (which works fine):

 

{ myDate: thedatepicker.SelectedDate}

 

I'm trying to bring it back in and re-populate a datepicker which has been reset to today().

 

I set the datepicker default to var_mysharepointtextdate.

 

Then I bring in the date back in from sharepoint list PARTIAL like this into pdatepicker:

 

UpdateContext({pdatepicker: LookUp(PARTIAL, PartialNAME = currentNAME, myDate)})

Then:

 

Set(var_mysharepointtextdate, pdatepicker);

 

Whatever I do the actual date picker shows either an error or is empty. Every combination of value/text etc throws doesn't work and it's driving me nuts.

 

I'm sure there is a very simple answer which I'm missing.

 

Can anyone help please?

 

Thanks for reading and have a great day 😉

1 ACCEPTED SOLUTION

Accepted Solutions
WarrenBelz
Super User
Super User

Hi @Bub ,

Assuming myDate is a Date field - you might do this

UpdateContext(
   {
      pdatepicker: 
      LookUp(
         PARTIAL, 
         PartialNAME = currentNAME, 
         myDate
      )
   }
);
Reset(thedatepicker)

then the Default of the date picker

If(
   Value(pdatePicker)>0,
   pdatepicker,
   Today()
)

 

Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs Up.

 

View solution in original post

4 REPLIES 4
WarrenBelz
Super User
Super User

Hi @Bub ,

Assuming myDate is a Date field - you might do this

UpdateContext(
   {
      pdatepicker: 
      LookUp(
         PARTIAL, 
         PartialNAME = currentNAME, 
         myDate
      )
   }
);
Reset(thedatepicker)

then the Default of the date picker

If(
   Value(pdatePicker)>0,
   pdatepicker,
   Today()
)

 

Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs Up.

 

View solution in original post

Bub
Helper I
Helper I

Thank you @WarrenBelz 😉

@Bub ,

So is this solved?

Bub
Helper I
Helper I

Sorry, yes it is, in that your posted solution worked. I found that I still couldn't get my specific issue resolved though and, instead, loaded everything into a gallery from which I could extract the date without issue. Thanks again.

 

Helpful resources

Announcements
User Group Leader Meeting January 768x460.png

Calling all User Group Leaders!

Don't miss the User Group Leader meetings on January, 24th & 25th, 2022.

Community Connections 768x460.jpg

Community & How To Videos

Check out the new Power Platform Community Connections gallery!

Top Solution Authors
Top Kudoed Authors
Users online (2,693)