cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
emegrant Advocate III
Advocate III

Need to use values from a SharePoint document library columns to set variables to use later in a Flow

Hi everyone,

 

I have a simple document library on a SharePoint on-line Office 365 site.  It only containes 4 PDF files and will most likely never have more than 4.  I have added 2 additional columns to the library to identify the YEAR (4 digit string value) and the QUARTER (2 digit string value) for each PDF.

 

I have a working Flow that will copy those 4 PDF files to an ARCHIVE document library folder but it is hard coded with the YEAR and QUARTER value(s).

 

What I want to be able to do is use the values from the source document library columns (YEAR and QUARTER) as part of the path for the ARCHIVE library.  Such as .../Archives/2019/Q1/PDF filename. The Year is self evident and the Quarter will be Q1 through Q4 for each of those years.  These PDF files are updated quarterly but we want to archive the past versions.

 

I have not been able to expose the added columns in FLOW so that I could assign their values to variables I could use later to specify the year and quarter for the path.

 

Any assistance will be greatly appreciated.

 

Thank you.

 

Ed

1 ACCEPTED SOLUTION

Accepted Solutions
Highlighted
emegrant Advocate III
Advocate III

Re: Need to use values from a SharePoint document library columns to set variables to use later in a Flow

Hi Everyone,

 

I have actually solved this issue in a slightly different way.

 

Instead of adding metadata columns to the document libraries, I created an imbedded PowerApp that passes information to a Flow that does the archiving.

 

To simplify the app and Flow, I pre-created the archive folder structure on my PC and dragged it over to the Archive SharePoint Document Library.  This structure covers a 10 year period so it should be good to go for our needs.

 

Attached are the codes I used in the PowerApp and photos of the Flow for general use.  This approach is pretty fast and just works perfectly for our needs.  I hope someone else in the community will find this useful.  Enjoy!

 

Thanks again for the help and suggestions.

 

Ed

 

Title: BCP Archive all Files per Quarter

Version: 2.0

Date: 02/21/2019

 

==============PowerApp PullDown codes===================

 

Year PullDown: Items =
["2018","2019","2020","2021","2022","2023","2024","2025","2026","2027","2028","2029"]

 

Quarter PullDown: Items =
["Q1","Q2","Q3","Q4"]

 

==============PowerApp Button codes===================

 

AP Button: OnSelect =
Set(MyRegion,"AP");
Set(MyDoc,"/PDF Masters/AP.pdf");
Set(SLib,"AP Source");
Archive_All.Run(MyRegion,MyDoc,MyYear.Selected.Value,MyQuarter.Selected.Value,SLib)

 

EU Button: OnSelect =
Set(MyRegion,"EU");
Set(MyDoc,"/PDF Masters/EU.pdf");
Set(SLib,"EU Source");
Archive_All.Run(MyRegion,MyDoc,MyYear.Selected.Value,MyQuarter.Selected.Value,SLib)

 

NA Button: OnSelect =
Set(MyRegion,"NA");
Set(MyDoc,"/PDF Masters/NA.pdf");
Set(SLib,"NA Source");
Archive_All.Run(MyRegion,MyDoc,MyYear.Selected.Value,MyQuarter.Selected.Value,SLib)

 

PS Button: OnSelect =
Set(MyRegion,"PS");
Set(MyDoc,"/PDF Masters/PS.pdf");
Set(SLib,"PS Source");
Archive_All.Run(MyRegion,MyDoc,MyYear.Selected.Value,MyQuarter.Selected.Value,SLib)

 

 

FLOW photos

Archive PowerApp main screen.JPGPowerAppArchive_1.JPGFlow - Screen 1Archive_2.JPGFlow - Screen 2Archive_3.JPGFlow - Screen 3Archive_4.JPGFlow - Screen 4

 

View solution in original post

3 REPLIES 3
Super User
Super User

Re: Need to use values from a SharePoint document library columns to set variables to use later in a Flow

@emegrant :

 

Can you provide sm more detail about the columns that you added to the library that you cannot access.  What types of columns are they (a screen shot of the column definitions would be helpful)?  What are the data types of your variables?

 

Scott

 

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

Scott
emegrant Advocate III
Advocate III

Re: Need to use values from a SharePoint document library columns to set variables to use later in a Flow

Hi,

 

The 2 columns are very simple text fields.  YEAR is 4 characters such as "2019" and QUARTER is 2 characters such as "Q1".  

 

All I really want to do is be able to read those fields and use them to populate a path that will be used to copy files from a Source document library to this new document library such as ".../ARCHIVES/YEAR/QUARTER/files"

 

Using the variables I would be able to use a single complete FLOW to handle any new YEAR or QUARTER as they com.  Those fields will be updated as the years and quarters come about.  Otherwise I would have to edit the FLOW each quarter to make the changes to point to the appropriate library in the Archives.

 

Thanks.

 

Ed

Highlighted
emegrant Advocate III
Advocate III

Re: Need to use values from a SharePoint document library columns to set variables to use later in a Flow

Hi Everyone,

 

I have actually solved this issue in a slightly different way.

 

Instead of adding metadata columns to the document libraries, I created an imbedded PowerApp that passes information to a Flow that does the archiving.

 

To simplify the app and Flow, I pre-created the archive folder structure on my PC and dragged it over to the Archive SharePoint Document Library.  This structure covers a 10 year period so it should be good to go for our needs.

 

Attached are the codes I used in the PowerApp and photos of the Flow for general use.  This approach is pretty fast and just works perfectly for our needs.  I hope someone else in the community will find this useful.  Enjoy!

 

Thanks again for the help and suggestions.

 

Ed

 

Title: BCP Archive all Files per Quarter

Version: 2.0

Date: 02/21/2019

 

==============PowerApp PullDown codes===================

 

Year PullDown: Items =
["2018","2019","2020","2021","2022","2023","2024","2025","2026","2027","2028","2029"]

 

Quarter PullDown: Items =
["Q1","Q2","Q3","Q4"]

 

==============PowerApp Button codes===================

 

AP Button: OnSelect =
Set(MyRegion,"AP");
Set(MyDoc,"/PDF Masters/AP.pdf");
Set(SLib,"AP Source");
Archive_All.Run(MyRegion,MyDoc,MyYear.Selected.Value,MyQuarter.Selected.Value,SLib)

 

EU Button: OnSelect =
Set(MyRegion,"EU");
Set(MyDoc,"/PDF Masters/EU.pdf");
Set(SLib,"EU Source");
Archive_All.Run(MyRegion,MyDoc,MyYear.Selected.Value,MyQuarter.Selected.Value,SLib)

 

NA Button: OnSelect =
Set(MyRegion,"NA");
Set(MyDoc,"/PDF Masters/NA.pdf");
Set(SLib,"NA Source");
Archive_All.Run(MyRegion,MyDoc,MyYear.Selected.Value,MyQuarter.Selected.Value,SLib)

 

PS Button: OnSelect =
Set(MyRegion,"PS");
Set(MyDoc,"/PDF Masters/PS.pdf");
Set(SLib,"PS Source");
Archive_All.Run(MyRegion,MyDoc,MyYear.Selected.Value,MyQuarter.Selected.Value,SLib)

 

 

FLOW photos

Archive PowerApp main screen.JPGPowerAppArchive_1.JPGFlow - Screen 1Archive_2.JPGFlow - Screen 2Archive_3.JPGFlow - Screen 3Archive_4.JPGFlow - Screen 4

 

View solution in original post

Helpful resources

Announcements
MBAS Gallery 2020

MBAS Gallery 2020

Watch Microsoft Business Applications Summit sessions on-demand.

firstImage

New Ranks and Rank Icons released on April 21!

The time has come: We are finally able to share more details on the brand-new ranks coming to the Power Automate Community!

firstImage

Now Live: Power Virtual Agents Community!

We are excited to announce the launch of Power Virtual Agents Community. Check it out now!

firstImage

New & Improved Power Automate Community Cookbook

We've updated and improved the layout and uploading format of the Power Automate Cookbook!

thirdimage

Power Automate Community User Group Member Badge

Fill out a quick form to claim your user group badge now!

sixthImage

Community Summit North America

The top training and networking event across the globe for Microsoft Business Applications

Users online (7,156)