Skip to main content
Question

How to name an output json file with the value of an attribute?


claireco
Contributor
Forum|alt.badge.img+1

Good morning

I want to generate a json file that accompanies a photograph and I want the name of the json file to be the name of the photo which is contained in a 'Photo' attribute

I also want as many json files named with the name of the photo as there are photos in my source directory.

I tested in the json output to put the Photo attribute in the entity name but it doesn't work.

ThanksCapture d’écran 2023-03-31 125203

4 replies

redgeographics
Celebrity
Forum|alt.badge.img+49

There's a Fanout option on the writer itself, in the Navigator, that can be used to make the filename dynamic based on an attribute. Set Fanout Dataset to Yes and then in the Fanout expression you can pick the attribute.


claireco
Contributor
Forum|alt.badge.img+1
  • Author
  • Contributor
  • March 31, 2023

Thank you, it works

How can I add the extension *.json at the end of the name of the json file ?


redgeographics
Celebrity
Forum|alt.badge.img+49
claireco wrote:

Thank you, it works

How can I add the extension *.json at the end of the name of the json file ?

Add .json to the end of that Fanout expression 😄


claireco
Contributor
Forum|alt.badge.img+1
  • Author
  • Contributor
  • March 31, 2023

Thank you for your prompt response, it works


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