Skip to main content

Notifications

Community site session details

Community site session details

Session Id : aVLZ2CtbJ7veowr20N7N1n
Power Pages - General Discussions
Unanswered

Making a File column mandatory in multistep form

Like (0) ShareShare
ReportReport
Posted on 6 Dec 2023 15:13:10 by 309

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:
  • Surendran Ravindran Profile Picture
    212 on 11 Dec 2023 at 11:20:19
    Re: Making a File column mandatory in multistep form

    @prathyoo 

    Yes , it works similar.

     

    -----------

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

  • psreek Profile Picture
    309 on 11 Dec 2023 at 11:06:04
    Re: Making a File column mandatory in multistep form

    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 09 Dec 2023 at 08:41:04
    Re: Making a File column mandatory in multistep form

    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.

     

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

🌸 Community Spring Festival 2025 Challenge 🌸

WIN Power Platform Community Conference 2025 tickets!

Markus Franz – Community Spotlight

We are honored to recognize Markus Franz as our April 2025 Community…

Kudos to the March Top 10 Community Stars!

Thanks for all your good work in the Community!

Leaderboard

#1
WarrenBelz Profile Picture

WarrenBelz 146,645 Most Valuable Professional

#2
RandyHayes Profile Picture

RandyHayes 76,287 Super User 2024 Season 1

#3
Pstork1 Profile Picture

Pstork1 65,997 Most Valuable Professional

Leaderboard
Loading started
Loading complete