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 III
Super User III

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 III
Super User III

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
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 (2,397)