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

Getting a file based on the name containing a number

Hi, I'm still a bit of a noob to PA, so please excuse any dumb questions.

 

I upload a folder containing pdf files to a central folder called "0000001 - All" (6 zeros, just so it stays on top without having to pin and shared users unpinning it).  From this folder files must be copied in to other folders sharing the same library based on the file names, which contain the number I'm looking for.

 

I managed to set up the flow below, which works for moving the file that contains "000001" (5 zeros), but when I follow the exact same process to copy the file which contains, eg. 511100, I the get error:

"Unable to process template language expressions for action 'Condition' at line '1' and column '17466': 'The template language function 'contains' expects parameters of matching types: a dictionary and a key (string), an array and a value (object), or a string and a substring. The provided types 'String' and 'Integer' are incompatible. Please see https://aka.ms/logicexpressions#contains for usage details.'."

Flow 1-2.PNG

Flow Cond.PNG

I've found very few posts on moving/copying files based on their name containing the value, those that do are very confusing in describing how the string element works.  The method I applied was just typing the value straight into the box, which worked.

1 ACCEPTED SOLUTION

Accepted Solutions
E_Nel
New Member

Ok, seems I resolved the issue by adding a string to the condition as per image below. 

I still have no idea why not adding a string on the first one I did worked, but not with the second flow.  Someone is more than welcome to comment on that.

 

Capture.PNG

View solution in original post

3 REPLIES 3
E_Nel
New Member

Here is a screenshot of the flow that works.  I saved a copy of the flow when I tried to do the next search and folder name as well as recreating it from scratch, no luck.

 

Working Flow.PNG

E_Nel
New Member

Ok, seems I resolved the issue by adding a string to the condition as per image below. 

I still have no idea why not adding a string on the first one I did worked, but not with the second flow.  Someone is more than welcome to comment on that.

 

Capture.PNG

FCGALLEG
Community Support
Community Support

Hi E_nel, 

 

Thanks for share the solution, I don't know if anyone would like to comment the solution.

 

Javier

Helpful resources

Announcements
Microsoft 365 Conference – December 6-8, 2022

Microsoft 365 Conference – December 6-8, 2022

Join us in Las Vegas to experience community, incredible learning opportunities, and connections that will help grow skills, know-how, and more.

Users online (4,187)