Solved

Use template sheet and don't overwrite existing file

  • 16 January 2023
  • 6 replies
  • 48 views

Badge +4

Hello,

in the past it was possible to set the options to no and still choose a template. Is there a workaround here? Why is that no longer possible? I would like to use a template and every time the workflow writes that this is done to the same file and not all spreadsheets are removed.

Options 

icon

Best answer by evieatsafe 24 January 2023, 20:07

View original

6 replies

Badge +4

@connecter​ Hi, and thanks for your question. Could you please let us know your FME version and build number where you are seeing this behavior? Thank you.

Badge +4

Hi @natalieatsafe​ , thanks for your response. It is: 2022.2.0.0 (20221103 - Build 22765 - WIN64).

Userlevel 1
Badge +15

Hi @connecter​ what version were you previously using that this was possible? I'm investigating this myself, and this hasn't been possible to set a template file when not overwriting the file since at least 2021. I believe this is expected behavior as the "template" the writer would use when not overwriting the file would be the existing file. If this were possible I believe this would cause conflicts between the file you are writing to and the template file you would select. If you have a specific use case or scenario where you would benefit from using a template file when not overwriting let us know! Perhaps create an Idea as well :)

 

I believe the workaround would be to read in the entirety of your existing file, perform the transformations, and then write the file to excel with Overwrite Existing File set to Yes to be able to set a template file and sheet.

Badge +4

Hi @connecter​ what version were you previously using that this was possible? I'm investigating this myself, and this hasn't been possible to set a template file when not overwriting the file since at least 2021. I believe this is expected behavior as the "template" the writer would use when not overwriting the file would be the existing file. If this were possible I believe this would cause conflicts between the file you are writing to and the template file you would select. If you have a specific use case or scenario where you would benefit from using a template file when not overwriting let us know! Perhaps create an Idea as well :)

 

I believe the workaround would be to read in the entirety of your existing file, perform the transformations, and then write the file to excel with Overwrite Existing File set to Yes to be able to set a template file and sheet.

Hi @Evie Lapalme​ ,

 

Thank you for your reply. I asked myself the same thing today and opened the old version 2021 again and unfortunately found the same thing. But I'm pretty sure it worked. This can also be seen on screenshots here in the forum.

For ease of presentation, here is an example that comes close to my use case. Every day I would like to run an evaluation and write it to a specific Excel file. The workflow should take a template and calculate the different amounts of the day and write them in the appropriate place (cells). The table plate gets the name of the respective day. The way it is now solved, I would have to create a new Excel list every day instead of adding it to the existing document as a new sheet, otherwise the Excel file will be overwritten. I hope you know what I mean.

Many greetings

Userlevel 1
Badge +15

Hi @Evie Lapalme​ ,

 

Thank you for your reply. I asked myself the same thing today and opened the old version 2021 again and unfortunately found the same thing. But I'm pretty sure it worked. This can also be seen on screenshots here in the forum.

For ease of presentation, here is an example that comes close to my use case. Every day I would like to run an evaluation and write it to a specific Excel file. The workflow should take a template and calculate the different amounts of the day and write them in the appropriate place (cells). The table plate gets the name of the respective day. The way it is now solved, I would have to create a new Excel list every day instead of adding it to the existing document as a new sheet, otherwise the Excel file will be overwritten. I hope you know what I mean.

Many greetings

If I've got this right, you want to append another sheet to the file (without overwriting the file) and for this sheet you want to add a template file? I believe this is still possible within the Feature Type parameters. You won't be able to set a template when not overwriting the entire file, but if you are appending a sheet to an existing file you can set the template for the specific sheet you are creating.

Below is the Feature Type parameters:

imageBelow are the Writer parameters, which are different than the Feature Type parameters:

imageLet me know if this is what you are looking for!

Badge +4

Hi @Evie Lapalme​ ,

 

Thank you for your reply. I asked myself the same thing today and opened the old version 2021 again and unfortunately found the same thing. But I'm pretty sure it worked. This can also be seen on screenshots here in the forum.

For ease of presentation, here is an example that comes close to my use case. Every day I would like to run an evaluation and write it to a specific Excel file. The workflow should take a template and calculate the different amounts of the day and write them in the appropriate place (cells). The table plate gets the name of the respective day. The way it is now solved, I would have to create a new Excel list every day instead of adding it to the existing document as a new sheet, otherwise the Excel file will be overwritten. I hope you know what I mean.

Many greetings

Hi @Evie Lapalme​ ,

thanks again for the reply. Unfortunately that doesn't work.

If I don't understand it wrongly, the FME help also states that this only works if a template has been selected beforehand:

"When you specify a Template File on the writer, this parameter allows you to specify the template sheet to use for this feature type."

Doesn't it make sense to gray out the option if no template has been selected? If I take the template as the output file in Writer and use the options as you described them, no template is used and the data is simply inserted without format.

Reply