January 12, 2021

Allow users to upload only specific extension files in Power Apps Attachment control

Introduction:

In this blog, we will learn how to allow users to upload only specific extension files in Power Apps Form Attachment control. The example here we have carried in this blog is to allow users to upload only the ".pdf" extension files.

Resolution:

Below are the steps we are going to work on here!

1.     Set restriction on uploading other extension files in Attachment control and notify the user when they upload any extension file other than ".pdf".

2.     Restrict the user from saving until resolving file errors.

Step 1: Set restriction on uploading other extension files in Attachment control

Place the below code at OnAddFile property of the Attachment control:

 If(  
   CountRows(  
     Filter(  
       RenameColumns(  
         DataCardValue4.Attachments,  
         "Name",  
         "NewName"  
       ),  
       Last(  
         Split(  
           NewName,  
           "."  
         )  
       ).Result <> "pdf"  
     )  
   ) > 0,  
   Notify(  
     "Only PDF files can be attached",  
     NotificationType.Error  
   );  
   ,  
   SubmitForm(Form1);  
   ResetForm(Form1);  
   EditForm(Form1);  
   )  

After placing this, check by adding a different extension file in the attachment control. You will be able to see this type of error at the top of the app.


Now as we have set the restriction message, let’s restrict the user from saving the form until all the attachments in the control are ".pdf".

Step2: Restrict user from saving until resolving file errors

Place the below code in the OnSelect property of the save button or in the OnSave property of SharePointIntegration:

  If(  
   CountRows(  
     Filter(  
       RenameColumns(  
         DataCardValue4.Attachments,  
         "Name",  
         "NewName"  
       ),  
       Last(  
         Split(  
           NewName,  
           "."  
         )  
       ).Result <> "pdf"  
     )  
   ) > 0,  
   Notify(  
     "Only PDF files can be attached",  
     NotificationType.Error  
   );  
   ,  
   SubmitForm(Form1);  
   ResetForm(Form1);  
   EditForm(Form1);  
   )  

Now add a different file extension in the control and click on save. It will show the below error and won’t let the user save the item.

Conclusion

This is how we can restrict users to upload only ".pdf" extension files in the Power Apps - Form Attachment Control.

If you have any questions you can reach out our SharePoint Consulting team here.

January 7, 2021

[Issue Resolved]: Default value of custom property in SPFx web part Property pane is not showing while running in Workbench Mode

Issue:

When we set the default value of custom property in the SPFx web part, it is not getting displayed in the Property pane while code is running in the Workbench mode (debug mode).

As shown below, We've set the default value of "SharePoint Training Custom List Name" custom property as "Training", but it is not displaying in the property pane while code is running mode.





Solution:

When we do any changes in “webpart.manifest” file, it will not reflect directly in the web part if it is in running mode.

To resolve this issue, please follow the below steps:

  • Stop the project execution if it is in running mode.
  • Re-build the project solution and re-run the project.
  • To rebuild the project please run the below-mentioned command respectively:
    • gulp clean
    • gulp build
    • gulp serve
  • Navigate to the SharePoint Workbench. Remove the existing web part from the page and add it again to reflect the changes.
  • Now, you will be able to see the default value of the custom property which we added for the "SharePoint Training Custom List Name" property in the property pane.






If you have any questions you can reach out to our SharePoint Consulting team here.

New Teams Meeting Experience with Large Gallery and Together Mode

Overview:

Sometimes, in Teams meeting, there’s a possibility that a large number of people joined the meeting with a camera turned on. At that time, it’s difficult to see everyone’s face on the width of a screen. So, what are options or alternatives? Let’s discuss this during this article! We will be discussing two new options which recently launched – “Together Mode” and “Large Gallery”. 

Prerequisite:

First, we need to enable New Meeting Experience for Teams.
  1. From the upper right corner of Teams, click on your profile icon.
  2. Click on Settings.
  3. From “General” make sure “Turn on new meeting experience (New meetings and calls will open in separate windows. Requires restarting Teams.)” option is enabled.
  4. Restart your Microsoft Teams.

With the new Microsoft Teams experience, now we have the following options available for Microsoft Teams experience. 
  • Gallery
  • Large Gallery (Preview)
  • Together Mode (Preview)

Gallery View:

This is the default view when anyone in Teams joins a call. In Gallery view, we can see 9 feeds at a time on the screen. Please see the below screenshot.

Large Gallery:

If the participant feed is 10 or more, this option is available for you. With a large Gallery, we can see the 49 participants at once. 

Together Mode:

  • Instead of seeing all the meeting participants in a square size of blocks, “Together Mode” provides a virtual space where we can see all team members together. This provides the same feel of face to face meeting experience. Recently due to the COVID pandemic, we celebrated our virtual Diwali on Teams. Here, you can see the experience looks awesome! 
  • We need at least 5 participants to activate “Together Mode”. With “Together Mode” we can see a Maximum of 49 people on a feed. 

Conclusion:

This is how we can utilize the “Together Mode” and “Large Gallery” options for a better team meeting experience. 

If you have any questions you can reach out our SharePoint Consulting team here.