cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
karenlacey
Frequent Visitor

Power Apps Attachment Control

Hi all, I followed Reza Dorrani's tutorial to add tagging to attachments. (16) Power Apps Attachment Control Tutorial | Multiple Attachment Controls | Tag SharePoint attachme... 

 

It all works but I need to include a timestamp. I inserted Now() but it isn't showing in the display areas. Any ideas? 

 

If( frmPropertyProposalForm.Mode = FormMode.View,
Filter(
colAttachments,
drpAttachTag.Selected.Value = "All"
|| StartsWith
( DisplayName,
drpAttachTag.Selected.Value & "-" & Now()
)
), colAttachments )
 
attachment.png
 
1 ACCEPTED SOLUTION

Accepted Solutions
cha_cha
Resident Rockstar
Resident Rockstar

Hello @karenlacey 

 

Please try this code

 

 

ClearCollect(
colAttachments,
Self.Attachments
);
UpdateIf(
colAttachments,
!(First(
Split(
DisplayName,
"-"
)
).Result in colAttachTags),
{
Name: drpAttachTag.Selected.Value & "-" & Text(Now(),"yyy-dd-mmm-hhmmss") & "-" & Name ,
DisplayName: drpAttachTag.Selected.Value & "-" & Text(Now(),"yyy-dd-mmm-hhmmss") & "-" & DisplayName 
}
)

 

These are the codes I 

cha_cha_0-1669209201772.png

 


 
Just in case you my answer helped you solve your problem, please mark/accept this as a SOLUTION This helps community members if they experience a similar issue in the future.

 
bistek.space   @cha_bistek    @BisTekSpace 

View solution in original post

7 REPLIES 7
cha_cha
Resident Rockstar
Resident Rockstar

Hello @karenlacey Preview

 

Convert your "Now()" code to a string format.

 

Text(Now(),"ddmmmyyyhhmmss")

 

 

Final code should be something like 

 

If( frmPropertyProposalForm.Mode = FormMode.View,
Filter(
colAttachments,
drpAttachTag.Selected.Value = "All"
|| StartsWith
( DisplayName,
drpAttachTag.Selected.Value & "-" & Text(Now(),"ddmmmyyyhhmmss")
)
), colAttachments )

 

 


 
Just in case you my answer helped you solve your problem, please mark/accept this as a SOLUTION This helps community members if they experience a similar issue in the future.

 
bistek.space   @cha_bistek    @BisTekSpace 
karenlacey
Frequent Visitor

Hi, thank you for the response. I tried this but it hasn't added any timestamp. By adding that code it has also impacted the ability to filter by tag. Any other ideas? 

 

attachment1.png

 

attachment2.png

cha_cha
Resident Rockstar
Resident Rockstar

Hello @karenlacey 

 

Sorry, I had the wrong assumption with the first code. Please keep the previous code to make your filter work.

 

May I know

(1) Is the timestamp that you need the "time" when user clicks submit? or when a photo is being selected for upload?

 

(2) Where in your form would you like the timestamp displayed?

 

 

Can you please show me your OnAddFile Property? Something similar below

 

cha_cha_0-1669208619108.png

 


 
Just in case you my answer helped you solve your problem, please mark/accept this as a SOLUTION This helps community members if they experience a similar issue in the future.

 
bistek.space   @cha_bistek    @BisTekSpace 
karenlacey
Frequent Visitor

Thank you for the quick response, ideally when the attachment is uploaded, I would like the timestamp to appear beside it, so have the tag, file name, timestamp in the attachments window

 

This is my code in the OnAddFile section

 

ClearCollect(
colAttachments,
Self.Attachments
);
UpdateIf(
colAttachments,
!(First(
Split(
DisplayName,
"-"
)
).Result in colAttachTags),
{
Name: drpAttachTag.Selected.Value & "-" & Name,
DisplayName: drpAttachTag.Selected.Value & "-" & DisplayName
}
)

 

 

cha_cha
Resident Rockstar
Resident Rockstar

Hello @karenlacey 

 

Please try this code

 

 

ClearCollect(
colAttachments,
Self.Attachments
);
UpdateIf(
colAttachments,
!(First(
Split(
DisplayName,
"-"
)
).Result in colAttachTags),
{
Name: drpAttachTag.Selected.Value & "-" & Text(Now(),"yyy-dd-mmm-hhmmss") & "-" & Name ,
DisplayName: drpAttachTag.Selected.Value & "-" & Text(Now(),"yyy-dd-mmm-hhmmss") & "-" & DisplayName 
}
)

 

These are the codes I 

cha_cha_0-1669209201772.png

 


 
Just in case you my answer helped you solve your problem, please mark/accept this as a SOLUTION This helps community members if they experience a similar issue in the future.

 
bistek.space   @cha_bistek    @BisTekSpace 
karenlacey
Frequent Visitor

Brilliant, this works perfectly. thank you so much for your help. 

 

attachmenttimestamp.png

cha_cha
Resident Rockstar
Resident Rockstar

You're welcome. glad I could help.


 
Just in case you my answer helped you solve your problem, please mark/accept this as a SOLUTION This helps community members if they experience a similar issue in the future.

 
bistek.space   @cha_bistek    @BisTekSpace 

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.

Community Call Conversations

Introducing the Community Calls Conversations

A great place where you can stay up to date with community calls and interact with the speakers.

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