Skip to main content
Announcements
Introducing Qlik Answers: A plug-and-play, Generative AI powered RAG solution. READ ALL ABOUT IT!
cancel
Showing results for 
Search instead for 
Did you mean: 
MarkM1
Contributor II
Contributor II

Dynamic file path for tFileOutputExcel

I am writing several Excel files in a job and reading them in a different job. I built them in Metadata so I could use the same definition. Now I want to copy this project to a new project, and the only difference is the file path. Is there a good way to pass in the file path like with a context. I know how to do this when the spreadsheet is not in the repository. But I want the spreadsheet definition in the repository.

0693p00000BWydmAAD.png 

I want all the spreadsheets to have the same path, and if I change the path, I only want to have to do it once. This works to save the file path in the context. But when I try to save the definition in the repository, this fails. (Property type - Repository) Is there a way to get the same functionality while the definition is stored in the repository?

Labels (2)
4 Replies
Anonymous
Not applicable

Hello,

Could you please let us know if this documentation helps?

TalendHelpCenter: Centralizing context variables in the Repository

Best regards

Sabrina

 

MarkM1
Contributor II
Contributor II
Author

No it does not. I know how to do that, and it applies to database connections. I want to do this for Excel, but the Excel component does not seem to like using contexts in the file path. If you retrieved it from the repository, it always switches things to an explicit path. In fact, you cannot create the metadata for an Excel file that includes context variables in the path. Unless I am missing something. That would be ideal.

JSey
Creator
Creator

I haven't tried it with tfileexcel component, but I know for components like tfileoutputdelimited, you can set the property type to repository and reference your repository, then override the filename in the component to context variable , thus keeping the schema referencing the repository, but you can use context variable for filename.

MarkM1
Contributor II
Contributor II
Author

Unfortunately with the Excel component, the filename is not changeable when you shift to repository, and if you do attempt to change the file name, it forces the component to Built-in. But what you described is exactly what I was expecting.