Skip to main content
Question

Excel File Reader - Dynamic sheet selection


aashnaparikh
Contributor
Forum|alt.badge.img+1

Description

  1. I have a excel template file which I have in the excel reader dataset as a reader file. This file only has the name of the attributes and no features.
  2. I am trying to implement this job for the end user where every month they can upload the excel file with the same template structure, however different features month on month basis. 
  3. I want to set up my parameters in a way that based off the template populated, it reads the file every month when uploaded by the end user and also give an ability to the end user to mention the sheet name in the prompt. 

3 replies

takashi
Supporter
  • April 8, 2025

Hi ​@aashnaparikh ,

If the Excel file that the user will upload has only a single sheet always, change the Excel reader feature type for the template sheet to single merged feature type. Then the merged feature type will read features from a sheet with any name, it doesn't need to select a sheet explicitely. 

If the Excel file could have two or more sheets and the user will have to select one of them when running the workspace, change the reader feature type to single merged feature type, and create a user parameter linked to the Feature Types to Read parameter in the Excel reader. Then, the user will be able to select a sheet after setting the source Excel file.

Hope this helps.


aashnaparikh
Contributor
Forum|alt.badge.img+1
  • Author
  • Contributor
  • April 9, 2025

Hi ​@takashi 

  1.  In the Excel Reader, uploaded the template file ( no data, only the attributes) and the sheet name here is Month Year Rejects
  2. Selected the individual feature type
  3. Now Created 2 user parameters for the input file and sheet name
  4. Linked the user parameter for the input file as the feature to read as you guided
  5. Ran the workspace. 
    1.  File in prompt : C:\ Dummy Path \ February2025RawData.xlsx. 
    2.  Sheet Name :  February 2025 Rejects 
  6. Note: This user file has 2 sheets February Rejects and Duplicates and the user only wants FME to read the February 2025 Rejects. Also the sheet structure is same as the template file sheet Month Year Rejects. 
  7. When I finally run the entire workspace, the visual preview displays the template file data rather than the Februry2025RawData > February 2025 Rejects

takashi
Supporter
  • April 9, 2025

Did you create the user parameter for selecting a feature type (sheet) to read by the right click menu "Create User Parameter" on the Excel reader parameter "Feature Types to Read", as in the screenshot I posted?

 


Cookie policy

We use cookies to enhance and personalize your experience. If you accept you agree to our full cookie policy. Learn more about our cookies.

 
Cookie settings