Hello everyone,
I have a folder with 3 files. The files have the same naming convention: nnnnnn-E1_Product name_LBL
I need to extract from the file name the Product name
I have split a text as below:
If I want to set a variable, I receive an error " Index '1' is out of range
Does anybody knows what is wrong?
Thank you for your kind support.
Solved! Go to Solution.
It's so weird. Mine is working just fine with [1]. This is weird, but have you tried deleting the command and redoing it. Also, show me your total flow screen. I want to make sure it's reading it correctly.
I'm heading into a meeting, so you won't hear from me for about an hour. Good luck!
Have you tried simply extracting with RegEx? It would save time with steps.
Copy and paste the below into the flow builder window and replace the text to parse with the file name variable.
Text.RegexParseForFirstOccurrence Text: Filename TextToFind: $'''(?<=_)(.*?(?=_))''' StartingPosition: 0 IgnoreCase: True Match=> varProductName
No...mine is working just fine.
Are you splitting text with the underscore?
Hi,
yes I am splitting with underscore
It's so weird. Mine is working just fine with [1]. This is weird, but have you tried deleting the command and redoing it. Also, show me your total flow screen. I want to make sure it's reading it correctly.
I'm heading into a meeting, so you won't hear from me for about an hour. Good luck!
@claudia from what you are showing, the index number you are using is within limits.
Could you paste a screenshot of your flow?
Have you tried simply extracting with RegEx? It would save time with steps.
Copy and paste the below into the flow builder window and replace the text to parse with the file name variable.
Text.RegexParseForFirstOccurrence Text: Filename TextToFind: $'''(?<=_)(.*?(?=_))''' StartingPosition: 0 IgnoreCase: True Match=> varProductName
Hi Michael,
I have checked the flow one more time and I saw that, the order of the actions was wrong 😬. I have made the correction and now is working.
Thank you for taking time to answer.
Hi,
RegEx is something very new and very interesting for me. I know it can be used, but it is not so easy for me to handle it. Please, beside the Microsoft documentation, do you know some sources from where a beginner like me could learn some things?
Please can you explain this expression:
(.*?(?=_))
Thank you
Claudia
The totality of the expression is doing a few things:
(?<=_)(.*?(?=_))
Hope that helps.
The first Microsoft-sponsored Power Platform Conference is coming in September. 100+ speakers, 150+ sessions, and what's new and next for Power Platform.
Learn to digitize and optimize business processes and connect all your applications to share data in real time.