Excel Validations in Data Entry Templates from my Webapp

I have a data entry platform and I want users to be able to upload data from an Excel source. The HTML form entry fields have some drop down menus and for consistency I want the very select items being options in the matching excel fields. Is this possible within django?

Welcome @franklwambo !

I’m not sure I understand exactly what you’re trying to do here.

It looks like to me that you’re looking for a two-step process:

  • First page: Upload Excel spreadsheet
  • Second page: Use the uploaded data as the display values for select widgets in forms.

If this is correct, then what I suggest you do is process that spreadsheet after it has been uploaded, extract the data that is supposed to be used, and store it in a Model. Then, your form can use the ModelChoiceField to use the data from that model as the options.

(If I’m not understanding the situation correctly, please provide a more detailed description of what you want to see happen and the order and sequence of steps in which it is to occur.)

@KenWhitesell thanks for the response. Let me shed more light on the need at hand. I want to permit data insertion by allowing users to download an Excel template, complete the template then upload to the web app. Users would be doing this as an alternative to form data entry fields which have drop downs. Now I want to limit the drop down fields on the app to be Excel choices in the Excel template downloaded from the site so that users do not end up feeding the Excel file with choices I do not have in my app.

image

Ok, so now I’m interpreting this in the reverse.

You want to create the spreadsheet template with the options that your form is using for the select fields?

@KenWhitesell Yes exactly

That’s not really a Django issue then. You need to find whatever libraries are available to allow you to create an Excel spreadsheet with the information in it that you want.

You would still (likely) want to have this data stored in models, and have a function that creates or modifies your template spreadsheet with that data.