Uploading Excel report in the frontend

Uploading Excel report in the frontend

  

Hello Everyone 

I am building a dashboard that will give a sales manager a view of their team's productivity.  

Now to make this possible, I need to expose the bootstrap functions to the administrators who are responsible for reports on the required data tables. (This is the requirement for this iteration, where the next one will have much more automatic actions.)   

Now that I have given you the context, here's my problem: 


  1. this is the usual bootstrap function and the convert node is looking to the resource folder for the "Sales" file. Here's the config:     

  2. Now on the front-end, I am using a form to help with the upload of the new data but also to keep a log of the timestamp and user details (for use elsewhere in the app): 


Here is a look at the Upload Report button's logic (Ignore the fact that the switch only has one condition right now - when we resolve my error I will duplicate the logic for the 3 other required conditions :) ) 


Now for the question, the file I am trying to upload in my production environment is the same structure and type as the one I used in my dev environment, but when completing the upload I get an error that reads: 


I made sure to point the upload content to replace the existing file in the resource folder. Can anyone help me here, please? 

Hello,

Just a thought...

Does the excel file you're uploading respecting the format?

The first line must be the header and the name of the columns must match the ones in your structure.

For example, if the first line is empty, you will get some error.

Also, are you fetching the correct excel tab? Be sure you set it correctly in the Excel To List.

Cheers

Hi Craig,

The error is clear: none of the column headers match with the record attributes :). So this likely means you have the wrong XLSX, or there's a bug in the code (e.g. wrong Structure used).

Also, I'm not seeing any logic to fetch the file...

Where is your Upload.Content? Without it you will not get anything from the upload widget (it does not put anything in the server automatically).

You need to pass the content to the excel to list.

Thanks guys

I think we missing the issue here.

When bootstrapping the file through the IDE in Dev, I don't get this error...

When I use the same file in through the frontend I then do get the error  

Hi Craig,

I'm not missing the issue I think. There's different logic involved, as far as I can see: a bootstrap Action in dev, and the Switch logic in production. You're also talking about using resources, how do we know they are the same resource? How can we know you specify the same Structure?

Craig Schrickker wrote:

Thanks guys

I think we missing the issue here.

When bootstrapping the file through the IDE in Dev, I don't get this error...

When I use the same file in through the frontend I then do get the error  

I disagree.

You are not fetching the content of the file you uploaded. You are using something it is already in the resources.

If the button is your submit, you need to pass the file content to excel.

So, instead of a resource, pass the Upload.Content to the Excel To List.

You are misunderstanding (apparently), how the upload of a file works.



Thank you for the feedback sirs!

I will give it go again... 

Solution

Craig Schrickker wrote:

Thank you for the feedback sirs!

I will give it go again... 

I found the error. 

In the config of my upload button, I did not identify/declare the sheet name.

It's working now. 

Thanks for help guys.  

Solution

It's often those tiny errors :). Debugging ftw :).