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 Pages / Making a File column m...
Power Pages
Unanswered

Making a File column mandatory in multistep form

(0) ShareShare
ReportReport
Posted on by 323

Hi,

 

We added two file columns on the Account table and exposed them in a step in the multistep form. We want to make these file columns mandatory but the metadata attribute drop down does not list file columns. How do I make them mandatory in the multistep form -

 

prathyoo_0-1701875506708.png

 

The first two "Choose File" maps to Account columns and the third "Choose Files" uses the Notes entity to store multiple other files.

 

Prathyoo

Categories:
I have the same question (0)
  • Surendran Ravindran Profile Picture
    212 on at

    Hi @prathyoo ,

     

    Method 1

    •  Make it as Bussiness Required in column setting

    Surendran_R_0-1702110553596.png

     

    Method 2:

    Add below java script in Form Step 

     

    Example : Note*  --> make changes based on your the field name/id

     

    $(document).ready(function(){
    //Replace Next with actual id of Next button
     $("#Next").click(function(){
    
     var fileInput = document.getElementById("fileInput"); 
    //Change fileInput with actual id of file field
    
     // Check if a file is selected
     if (fileInput.files.length === 0) {
     alert("Please select a file.");
     event.preventDefault(); // Prevent form submission
     }
     
     });
    });

     

    Regards

    Surendran Ravindran

     

    --------------------------------------------------------------------------------------

    Hope that helps.

    If the post solves your problem, please mark it as solution. If it helps, consider a thumbs up.

     

  • psreek Profile Picture
    323 on at

    Thanks. I resolved this similar to your solution. I set Required property of the two file columns to 'Business Recommended'. Then in the 'Document' step of the multistep form I updated the following property to 'Yes'

     

    prathyoo_0-1702290200723.png

    prathyoo_1-1702290303546.png

     

    And now the file columns are mandatory in the form. I see that this generates a javascript to carry out the validation. Can you also confirm that the validation also occurs at the server side if someone were to play with the js on the browser.

  • Surendran Ravindran Profile Picture
    212 on at

    @prathyoo 

    Yes , it works similar.

     

    -----------

    If the above post solves your problem, please mark it as solution.

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

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Users!

Kudos to our 2025 Community Spotlight Honorees

Congratulations to our 2025 community superstars!

Congratulations to the March Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Pages

#1
rezarizvii Profile Picture

rezarizvii 71

#2
DP_Prabh Profile Picture

DP_Prabh 36

#3
oliver.rodrigues Profile Picture

oliver.rodrigues 32 Most Valuable Professional

Last 30 days Overall leaderboard