cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
GauthierCRP
New Member

Condition with Onedrive

Hello Everyone,

 

I'm beginner with Power Automate. I'm currently trying to establish a flux in order to sort different files, in different directories, based on the file name of each file.

 

I use the "condition" tool, with the contains expression, as you can see in the scrennshoot below. The main issue is that the result of the condition is always "false" even if, the name of the file contains the right expression.

 

Can you help me figure what i'm doing wrong, syntaxe, expression ?

 

Many Thanks in advance,

Gauthier

Power Automate.jpgFact.jpg

 

 

 

1 ACCEPTED SOLUTION

Accepted Solutions
MarconettiMarco
Resident Rockstar
Resident Rockstar

Hi  @GauthierCRP ,in the Condition add the following expression instead of "File name":

 

triggerOutputs()?['headers']['x-ms-file-name']

 

Please let me know.

If I have answered your question, please mark your post as Solved.
If you like my response, please give it a Thumbs Up.

 

BR,

Marco

View solution in original post

16 REPLIES 16
MarconettiMarco
Resident Rockstar
Resident Rockstar

Hello @GauthierCRP ,

try to include 302852 in single quotes.

 

If I have answered your question, please mark your post as Solved.
If you like my response, please give it a Thumbs Up.

 

BR,

Marco

GauthierCRP
New Member

Hello @MarconettiMarco,

 

I tried, but unfornately, I have same results. All files are move to "false" directory, even if the name of the file contains 302852...

 

Any idea ?

 

Many Thanks and Best Regards,

Gauthier

After the trigger, try to add "Compose" action and add into the OneDrive file name. Then run the flow and see what is the Compose Output.

 

Let me know

 

BR,

Marco

Sorry @MarconettiMarco but what is a "compose" action ? I'm very beginner with Automate.

Hello @GauthierCRP ,

np.

 

Add the following action after the trigger:

MarconettiMarco_0-1656000194783.png

Then in the inputs add your field on which yoy want to apply the condition.

 

Run the flow and see what is the Compose output like below:

MarconettiMarco_1-1656000319338.png

 

 

BR,

Marco

Hey @MarconettiMarco,

 

No 'Compose' operation for me. I'm turning mad with it ! 🙂

 

GauthierCRP_0-1656001589991.png

Best Regards,

Hey,

try Message action.

sorry but it’s in french…

dominikmad
Advocate I
Advocate I

You'll do yourself and everyone else a huge favor, if you switch the power automate language to english. Maybe you're also using the wrong output for the condition, the thing that starts with "nom de ..." - what does it mean in english and is it the unformatted name of the file? You can check what it "outputs" if you just go back to the flow, click on it and then click on one of the executions (at the bottom):

dominikmad_0-1656059144605.png

There you can see, what value he uses in your condition function, and maybe youre just using the wrong one.

I Everyone, unfortunaltely,

The language is set and blocked by my enterprise administrator...

Nom du fichier = Name of the File in English

 

When I check the raw Inputs and Output, I see that the "Nom de Fichier" / "Name of file" is a sequence of characters with unrelated with the existing name of file I'm trying to sort.

GauthierCRP_0-1656400937692.png

 

Any idea, why ?

Thanks

 

MarconettiMarco
Resident Rockstar
Resident Rockstar

Hi  @GauthierCRP ,in the Condition add the following expression instead of "File name":

 

triggerOutputs()?['headers']['x-ms-file-name']

 

Please let me know.

If I have answered your question, please mark your post as Solved.
If you like my response, please give it a Thumbs Up.

 

BR,

Marco

Hi @MarconettiMarco,

 

The result is ALWAYS, false, false false and false... 😞

Even If the "Name of the File" complies with the condition "Start with"

GauthierCRP_0-1656403607130.png

What I'm asking to Power Automate is so simple, I can't believe that it's so hard to set ! I am the only one trying to sort file by "File Name" ?

 

By the way, many thanks for your help.

BR.

Add the Compose action before the Condition and put in the same expression.

What is the output?

 

BR,

Marco

GauthierCRP_0-1656404871602.png

Marco, I'm really sorry, and I don't now why, but I don't see the "Compose" option.

 

Analyser JSON = Analyze JSON

Créer un tableau CSV = Create à CSV table

Créer un tableau HTML = Create an HTML table

Filtrer un tableau = Filter a table

Jointure = Join

Message = Message

Selectionner = Select

 

So where is this compose option ?

 

Thanks

 

 

Hi @GauthierCRP ,

please change in English language.

Anyhow it should be your "Message" action.

 

If I have answered your question, please mark your post as Solved.
If you like my response, please give it a Thumbs Up.

 

BR,

Marco

GauthierCRP_1-1656406660318.png

The Output, is the Name of the File, correctly writed... But then, the condition does not work on it.

 

Best Regards

Gauthier

ok @GauthierCRP ,

for me it's working correctly because the condition says contains "302852", but your file name contains "30582".

 

BR,

Marco

Helpful resources

Announcements
Power Platform Conf 2022 768x460.jpg

Join us for Microsoft Power Platform Conference

The first Microsoft-sponsored Power Platform Conference is coming in September. 100+ speakers, 150+ sessions, and what's new and next for Power Platform.

New Ideas Forum MPA.jpg

A new place to submit your Ideas for Power Automate

Announcing a new way to share your feedback with the Power Automate Team.

MPA Virtual Workshop Carousel 768x460.png

Register for a Free Workshop

Learn to digitize and optimize business processes and connect all your applications to share data in real time.

MPA Licensing.jpg

Ask your licensing questions at the Power Automate AMA!

Join Priya Kodukula and the licensing team, super users and MVPs to find answers to your questions on Power Automate licensing.

Users online (2,647)