web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / How to ensure files fo...
Power Apps
Unanswered

How to ensure files for required columns are uploaded in model-driven app

(0) ShareShare
ReportReport
Posted on by

I might be missing something here but if I have a table that includes a required file column how do I ensure that the record has a file uploaded to that column as it is a 2-step operation (1. Create the record and then 2. Upload the file).

 

The file column is only required on subsequent saves, not the initial creation.

 

This must be a common use case but I can't figure out how to be certain that a file is uploaded (I need it for compliance checks later).

 

Essentially I want to have a record that has some required text columns AND a required file column and know 100% that everything is entered.

 

At the moment there is a risk that a user enters the required text, hits save and never uploads the file.

 

Do I need to come up with a different design/strategy?

 

Categories:
  • narayan225 Profile Picture
    2,547 Moderator on at

    @nuxibyte 

     

    You can use a business rule to validate this. Add condition to check if the created on field has value and then continue with your business rule to make the necessary field as required.

    narayan225_0-1690250791699.png

     

    If you want, you can use a JS to make it required after the record has been created.

    function setFiedrequirementasrequired(executionContext)
    {
     // Getting formContext 
     var formContext = executionContext.getFormContext();
     var formType= Xrm.Page.ui.getFormType();
     // Check condition if page is create or update and if it is update, set the fields are required.
     if (formType == 2)
     {
     //setting Email field requirement as required/mandatory.
     formContext.getAttribute("emailaddress1").setRequiredLevel("required");
     // setting Mobile phone field requirement as required/mandatory.
     formContext.getAttribute("mobilephone").setRequiredLevel("required");
     }
     else
     {
     //setting Email field requirement as none.
     formContext.getAttribute("emailaddress1").setRequiredLevel("none");
     // setting Mobile phone field requirement as none.
     formContext.getAttribute("mobilephone").setRequiredLevel("none");
     
     }
    }

     Hope this helps.

     

    Cheers!

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

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Leaderboard > Power Apps

#1
11manish Profile Picture

11manish 396 Super User 2026 Season 2

#2
Mohsin Ali Profile Picture

Mohsin Ali 323

#3
WarrenBelz Profile Picture

WarrenBelz 193 Most Valuable Professional

Last 30 days Overall leaderboard