Forums

Forums / Developing Portals / File- Upload

File- Upload

Thread is closed for posting
2 posts, 1 answered
  1. Krishna Hari
    Krishna Hari avatar
    65 posts
    Registered:
    05 Dec 2019
    Answered
    13 Jan 2020
    Link to this post
    Is it possible to Create rules on number of files needed to be uploaded based on some other field value? a Business requirement needs to have 3 files uploaded in case of option A, 5 files in case of option B, How could we approach it?
  2. Alex
    Alex avatar
    19 posts
    Registered:
    27 Sep 2018
    13 Jan 2020 in reply to Krishna Hari
    Link to this post
    Hello Krishna, 
    This would be possible however you would need to do some custom JS to make it work. 
    You could have a rule in the rules manager that says if option = A, run this code. If option = B then run this other piece of code. 
    In your code you would have some validation that would make sure the dataSource of the widget you are using (SharePoint or upload widget) has at least x amount of files. 

    Another way to do this would be to create a preValidate event (take a look at our documentation for "portal form submission events") in your ore validate you would check what option the user chose on the picklist, based on that option you would have another check that would make sure the dataSource of the widget you chose has more than x number of items. 
    Let me know if this works for you or if you have any other questions. 
2 posts, 1 answered