Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and more.
Get startedGrow your Fabric skills and prepare for the DP-600 certification exam by completing the latest Microsoft Fabric challenge.
Hi Community.
I have 3 different sources in order to import all files using Folder.Files importation option...
SourceA = ...
SourceB = ...
SourceC = ...
To do so, I am trying to apply "try ... otherwise" in Folder.Files same as I did with Excel.Workbook, but it seems with Folder.FIles it is not working same way.
I tried at least 2 Scripts, but both failed to find my network path which is SourceC. If I transfer F:\Pilot\Pilot_Bases_Actual_Year to SourceA, then it works. So I am assuming try stetament is not going down to SourceB and SourceC as expected. Can anyone help me understand why and how to fix it?
Script 1:
SourceA = try Folder.Files("C:\Users\jaderson.almeida\Havas\OneDrive - Havas\Pipeline 2017\SupportTables\Pilot_Bases_Actual_Year"), SourceB = try Folder.Files("G:\FINANCEIRO\MO Controller\Pilot\Pilot_Bases_Actual_Year"), SourceC = try Folder.Files("F:\Pilot\Pilot_Bases_Actual_Year"), DynamicSource = if SourceA[Value] is table then SourceA[Value] else if SourceB[Value] is table then SourceB[Value] else if SourceC[Value] is table then SourceC[Value] else null, Source = DynamicSource,
Rest of script
Script 2
SourceA = Folder.Files("C:\Users\jaderson.almeida\Havas\OneDrive - Havas\Pipeline 2017\SupportTables\Pilot_Bases_Actual_Year"), SourceB = Folder.Files("G:\FINANCEIRO\MO Controller\Pilot\Pilot_Bases_Actual_Year"), SourceC = Folder.Files("F:\Pilot\Pilot_Bases_Actual_Year"), DynamicSource = try SourceA otherwise try SourceB otherwise try SourceC otherwise null, Source = DynamicSource,
Rest of script
Thanks in advance again,
Jimmy
Hi @bajimmy1983,
Could you please mark the proper answer as solution?
Best Regards!
Dale
Hello @v-jiascu-msft. Sorry to delay my reply. I am on vacation with very limited email access.
So, I tried your suggestion, but no way, it failed.
Yes, same construction steps.
Hi Jimmy,
Since it's a network folder, maybe you can try it out like this: \\computer name\folder path.
SourceC = try Folder.Files("\\Pilot\Pilot_Bases_Actual_Year"),
I have to ask if all the files have the same structures. Or the following steps will be broken if the data source switches among the three sources.
Best Regards,
Dale
Join the community in Stockholm for expert Microsoft Fabric learning including a very exciting keynote from Arun Ulag, Corporate Vice President, Azure Data.
Check out the June 2024 Power BI update to learn about new features.
User | Count |
---|---|
91 | |
87 | |
80 | |
69 | |
69 |
User | Count |
---|---|
226 | |
129 | |
119 | |
83 | |
77 |