I would like to include the value of a field when outputting data in the lake.
At present the following will out the following file format
tablename_yyyyyMMdd_yyyyMMddhhmmss.csv
@concat(
pipeline().parameters.TableName,
'_',
formatDateTime(utcNow(),'yyyyMMdd'),
'_',
formatDateTime(utcNow(),'yyyyMMddhhmmss'), '.csv'
)
I no longer need the first formatDateTime(utcNow()
function.
Instead I would like to replace it with the value of a particular field name e.g first_name. Therefore, maybe it would change to something like the following:
@concat(
pipeline().parameters.TableName,
'_',
first_name),
'_',
formatDateTime(utcNow(),'yyyyMMddhhmmss'), '.csv'
)
Although, I'm sure the above is incorrect, but hopefully you get what I'm trying to say.
Any thoughts?
I should point out the field will only have a single value for all rows e.g. if there were 100 rows and the first_name was jonathan, it would be same for all 100 rows
So I would be needing help to get the following output tablename_jonathan_yyyyMMddhhmmss.csv
I've just had a thought...
Would it be possible to concatentate the FirstName to the TableName parameter seen the image below:
So, a preview of the actual table looks like the image below, I would like to add the 'first_name' to output file as suggested above, so that it would look like the following
tablename_jonathan_yyyyMMddhhmmss.csv
By way of an update, following a potential solution I'm getting the error shown in the image
Basically, I'm getting the error:
The output of activity 'Lookup1' can't be referenced since it is either not an ancestor to the current activity or does not exist
FirstName
are all same and you want to use that value in the sink file name, you can first use look up (first row only) on the table. This would give data as shown in the below image:TableName
parameter (my sample value is sample1
) to build the required sink filename. The following is the dynamic content that I used:@concat(pipeline().parameters.tableName,'_',activity('Lookup table').output.firstRow.firstName,'_',formatDateTime(utcNow(),'yyyyMMddhhmmss'),'.csv')