Hi,
in my work I use a rocketbook, which sends pdf-files to one certain folder in my onedrive. These pdf-files have different filenames, depending on the headline I gave them in my book. It is a matter of order not to give too many different headlines, and I want flow to move (or copy, if it is a difference) the files to different subfolders.
Most Helpful would be to just analyze a part of the filename (for example until a certain letter appears): "Filename$$.pdf" for example could use just the part from first letter to $$ as a destination folder.
A little less helpful, but practicable would be to use the complete filename, but then I would add a timestamp to the filename when moving/copying.
1. The trigger is "When a file is created" in my opinion.
2. Next step is "Create file" in a different folder.
3. Last step is "Delete file" in the triggered folder.
But how can I use a part of the filename in the 2. step for changing the target folder?
Thanks in advance,
C.
Solved! Go to Solution.
Hello everybody,
I just figured it out, but in a different way:
replace(variables('Dateiname'), '.pdf', ''
concat(FormatDateTime(AddDays(convertTimeZone(utcnow(),'UTC','W. Europe Standard Time','yyyy-MM-dd'), -1), 'yyyy-MM-dd'), '.pdf')
I store the name of the file in a variable and change the output by removing the '.pdf', adding the current date and '.pdf'.
This works
If there are any questions, feel free to ask.
Greetz, Goodmountain
Hi @Goodmountain ,
You could try the following method to configure Flow.
Expression reference:
first(split(triggerBody()?['DisplayName'],'$$'))
Image reference:
Best Regards,
Hi Barry,
that'a weird, I receive an error that the first paramter value is not a string...
I used your expression reference as it is, but it didn't looked like I had to change anything in it.
Why is this expression of type 'Null', the reason can't be the format pdf, am I right?
Best regards,
Goodmountain
Ok, the mist is getting lighter
I tried your example, but with a completely different content of "Compose".
It was replaced with
min(1, 5, 4, 3)
and gave back - surprise - "1".
So, the expression
first(split(triggerBody()?['DisplayName'],'$$'))
gives back 'Null' and the flow stops...
The triggerBody() is completely unknown to me, but it doesn't seem to give back a part of the filename... in fact it sees not to give back anything at all.
The manual (https://docs.microsoft.com/en-us/azure/logic-apps/workflow-definition-language-functions-reference#t... doesn't help me with the expression 'DisplayName' or any other possibilities. Is there a more detailed manual, which I did not find yet?
Thanks in advance,
Goodmountain
Hello everybody,
I just figured it out, but in a different way:
replace(variables('Dateiname'), '.pdf', ''
concat(FormatDateTime(AddDays(convertTimeZone(utcnow(),'UTC','W. Europe Standard Time','yyyy-MM-dd'), -1), 'yyyy-MM-dd'), '.pdf')
I store the name of the file in a variable and change the output by removing the '.pdf', adding the current date and '.pdf'.
This works
If there are any questions, feel free to ask.
Greetz, Goodmountain
User | Count |
---|---|
16 | |
16 | |
14 | |
9 | |
8 |
User | Count |
---|---|
28 | |
27 | |
24 | |
23 | |
14 |