Skip to main content

Notifications

Power Apps - Building Power Apps
Answered

Submit datepicker as metadata to document library

(0) ShareShare
ReportReport
Posted on by 10

I currently have trouble with something VERY similar if not entirely like this post:

https://powerusers.microsoft.com/t5/Building-Power-Apps/SUBMIT-DATE-PICKER-DATE-TO-SHAREPOINT-FORMULA/td-p/740142

 

However, if you read one of my recent comments ( I don't think this user is active anymore ), you'll note that I either don't know how to implement this correctly, or I'm fudging the flow/powerapps formula.

 

I googled and copied:

formatdatetime(triggerBody()['Updatefileproperties_EndDate'],'mm/dd/yyyy')
 
When it comes to my formula for PowerApps, I have managed to get it to work with almost all other data types to include a people picker, but I can't get it to work with the date picker. The formula I'm using is:
 

Set(varDemoFromAttachmentControl, JSON(Image1.Image, JSONFormat.IncludeBinaryData));
Set(varBase64Only, Mid(varDemoFromAttachmentControl, Find(",", varDemoFromAttachmentControl)+1, Len(varDemoFromAttachmentControl) - Find(",", varDemoFromAttachmentControl)-1 ));

Set(varFileLink, 'EasyUpload'.Run(Last(AttachmentControl.Attachments).Name, varBase64Only, DataCardValue7.SelectedDate).sharepointfilelink);

 

This entire formula was taken by Shane Young on his video: https://www.youtube.com/watch?v=3QaiM8SeWfM&t=0s

 

Can someone point me in the right direction?

 

Thank you

  • WarrenBelz Profile Picture
    WarrenBelz 145,666 on at
    Re: Submit datepicker as metadata to document library

    Hi @patgat96 ,

    You need Create file for a Library (not Create item) - just add the date into the field in there.

     

    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.

    Visit my blog Practical Power Apps

  • patgat96 Profile Picture
    patgat96 10 on at
    Re: Submit datepicker as metadata to document library

    I'm running into a problem in the flow. Whenever I try to make the "create item" option, I cannot choose the document library. I'm not sure if this is because I've already called it once for the "create file" section or if it's because it's a document library and not a list.

  • Verified answer
    WarrenBelz Profile Picture
    WarrenBelz 145,666 on at
    Re: Submit datepicker as metadata to document library

    Hi @patgat96 ,

    To things here - firstly the parameter for your date needs to be

    Text(DataCardValue7.SelectedDate,"mm/dd/yyyy")

    and then in your Flow, you need to put it back to a Date - example below I just tested and it worked fine.

    WarrenBelz_0-1659646319563.png

    Also a bit of optimising of your code to avoid leaving Variables "hanging around"

    With(
     {
     wJSON: 
     With(
     {
     wJSONI: 
     JSON(
     Image1.Image,
     JSONFormat.IncludeBinaryData
     )
     },
     Mid(
     wJSONI,
     Find(
     ",",
     wJSONI
     ) + 1,
     Len(wJSONI) - 
     Find(
     ",",
     wJSONI
     ) - 1
     )
     )
     },
     Set(
     varFileLink, 
    	 'EasyUpload'.Run(
     Last(AttachmentControl.Attachments).Name, 
     wJSON, 
     Text(DataCardValue7.SelectedDate,"mm/dd/yyyy")
     ).sharepointfilelink
     )
    );

     

    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.

    Visit my blog Practical Power Apps

     

     

     

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Microsoft Kickstarter Events…

Register for Microsoft Kickstarter Events…

Announcing Our 2025 Season 1 Super Users!

A new season of Super Users has arrived, and we are so grateful for the daily…

Announcing Forum Attachment Improvements!

We're excited to announce that attachments for replies in forums and improved…

Leaderboard

#1
WarrenBelz Profile Picture

WarrenBelz 145,666

#2
RandyHayes Profile Picture

RandyHayes 76,287

#3
Pstork1 Profile Picture

Pstork1 64,996

Leaderboard