cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
MichalMaciazek
New Member

Problem with tagging items added as attachments

Hi everyone,

based on the video -> (https://www.youtube.com/watch?v=hJQjGE-oUpM&lc=UgzfMAk3ib0_Q-ykh4x4AaABAg.9cmRfLBzJlL9cmm_N2deXb)  I'd like to add tags to my attachments based on two dropdown fields.

Thanks to the information contained in the video material - it was achieved - but there is a little problem ..
each time I add a new attachment, the tag is added to all attachments - including those previously added to the collection.  This results in duplicate tags (as can be seen in the photo in the attachment). How to make adding a tag apply only to attachments that will be just added?

 

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

 

I would be grateful for help.

Michał Maciążek

1 ACCEPTED SOLUTION

Accepted Solutions
v-jefferni
Community Support
Community Support

Hi @MichalMaciazek ,

 

You have modified the formula to add spaces beside the dash symbols, which will make the Split function not work as expected. Please try and add spaces for the dash symbol in the Split function as well:

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

 

Best regards,

Community Support Team _ Jeffer Ni

If this post helps, then please consider Accept it as the solution to help the other members find it.

View solution in original post

2 REPLIES 2
v-jefferni
Community Support
Community Support

Hi @MichalMaciazek ,

 

You have modified the formula to add spaces beside the dash symbols, which will make the Split function not work as expected. Please try and add spaces for the dash symbol in the Split function as well:

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

 

Best regards,

Community Support Team _ Jeffer Ni

If this post helps, then please consider Accept it as the solution to help the other members find it.

Thank You! It helped :).

But unfortunately, now I have an error when I use Office365Outlook.SendEmailV2.

This problem occurs only if I add attachments.

This information about the problem appears:

 

pa_error.JPG

This is how my function looks like :

Office365Outlook.SendEmailV2("XY;YZ","Audyt TPM - Wydział Cięcia - Zmiana " & zmiana.Selected.Value & " - " & Text(Now(),"dd-mm-yy"),HtmlText1.HtmlText,{Attachments:AddColumns(RenameColumns(DataCardValue8.Attachments,"Value","ContentBytes"),"@odata.types",""),Importance:"Normal"});

Helpful resources

Announcements
Power Platform Conf 2022 768x460.jpg

Join us for Microsoft Power Platform Conference

The first Microsoft-sponsored Power Platform Conference is coming in September. 100+ speakers, 150+ sessions, and what's new and next for Power Platform.

365 EduCon 768x460.png

Microsoft 365 EduCon

Join us for two optional days of workshops and a 3-day conference, you can choose from over 130 sessions in multiple tracks and 25 workshops.

Users online (3,474)