cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Anonymous
Not applicable

Sharepoint list auto export to excel

Would anyone have a flow suggestion that will, in Powerapps, when a button is pressed, that the data from my SharePoint list could be exported to an excel workbook and then send the excel file as an attachment in Outlook? 

33 REPLIES 33
Anonymous
Not applicable

Hi @Anonymous I try to avoid multiple selection columns as much as I can (too much headaches) and have no example at hand. With regards to the datetime format, you may find the solution here.

I often use a formatDateTime() expression in Compose actions, then use the Output of the Compose action to display the date in the desired format. Example:

Beat_0-1656077024098.png

Expression: 

formatDateTime(outputs('Get_GCC_item')?['body/endDate'],'dd.MM.yyyy')
 
You can construct the expression by selecting Expression, type formatDateTime( and then switch to dynamic content and insert the date to be converted, then type ,'<your date format>').
You will find all the possible formats under the link I provided above. Important to note is that MM is month while mm is minutes. Good luck!
Anonymous
Not applicable

```

InvalidTemplate. Unable to process template language expressions in action 'Add_a_row_into_a_table' inputs at line '0' and column '0': 'In function 'formatDateTime', the value provided for date time string 'Created' was not valid. The datetime string must match ISO 8601 format.'.

```

Screenshot 2022-06-24 170453.jpg

 

 

The error seems obvious, i've added string 'Created' (the name of the column) instead of linking the actual column...but i can't link the actual column, if i switch to dynamic content i can only choose body or value

I tried placing the Compose before the Get items (as per your example) but it doesn't let me chose the column i'm interested in.

I know i must be infuriating (a complete n00b) ...but i do try to google before coming here first. Power Automate seem very logic, up to a point. I was expecting this to be really easy ...like: add a row, for column X convert time from whatever you find in whatever i want ... but noooo

Anonymous
Not applicable

Anonymous
Not applicable

Yeah... it doesn't want to cooperate.

So the column which has a list/array object doesn't want to provide me with the value i'm interested (i tried mapping first('column_name')?['name']  ... no good)

The column with the iso8601 refuses to give me the "normal" time (I tried to mapp directly with formatdatetime('Get_items', 'yyyy/MM/dd HH:mm') ... i get same error as above ...; I also tried to do the convert time zone right after Get_items ... the moment i select the column i'm interested it converts into a apply to each loop ... and still gives the same errors).

I am ready to let go of this issue though, as I can probably do the transformation inside SQL (the data i pull from the Sharepoint List, and dump into an excel ... will get pushed through a Python script into a PostgreSQL DB).

So, i'm left with the that colum that doesn't want to provide me with the value I need (DisplayName) but it return a list

Anonymous
Not applicable

@Anonymous with the FormatDateTime function I can't help you much (I don't see why it wouldn't work) but I made a little test on my side for the multiple selection column.
I created a SharePoint list with two columns, Team and Person, where Team is a single line of text and Person is a Person column that allows multiple selections. I want their emails, but not send 3 emails if there are 3 people picked, only one with the 3 email addresses. For the first part it's quite simple:

Beat_0-1656155911914.png

Note that we initialize the variable varEmails to store the email addresses. In the Get items action I added an ODATA filter 'Person ne null' as I don't want to process any item that has no email address (or no DisplayName in your scenario). Since we are going to use the variable within a for each loop, we must set the Concurrency Control of the flow to 1 (as otherwise, if a flow is started while the previous one is still running, it may pick up the values from the other flow). You do this in the settings of the trigger itself.

Beat_4-1656157445791.png

Then I added a 'Get item' action, from the same list, with the ID from the 'Get items' outputs. This automatically wrapped it into the first Apply to Each:

Beat_1-1656156632372.png

Next I added an action 'Append to string variable', which was wrapped in Apply to each 2, nested within the first for each loop when I added the Person field. I used a semicolon to separate the values, as this way the variable can be directly used to send one message to multiple emails:

Beat_2-1656156836625.png

Then, below and outside that Apply to each 2, back in the first Apply to each, I added the 'Add a row into a table' action, using the varEmails variable. At this point I could as well send an email, using the variable on the TO: line

Beat_3-1656157260334.png

And finally, I set the variable to null, in order to clear the email addresses and start from scratch for the next item.
Please give me a thumbs up if you find this useful. Thank you!

Anonymous
Not applicable

Same issue as before, the moment I'm trying to replicate your apply to each 2 and select the column that piece of flow changes into an apply to each 3, at select output it changes into value, and then the apply to each 2

Anonymous
Not applicable

@Anonymous you don't need to create the Apply to each 2, it will create it automatically when you select the field (e.g. Person DisplayName or Person Email) from dynamic content. Put a screenshot of your flow here.

Anonymous
Not applicable

Currently my flow is like this:

Manual trigger, search in an Excel Template and delete ever row (i went with this as doing an "update when new items" is not consistent... most of the times it triggers the flow but doesn't pull the new data). Next is getting the items from the SP list.

Next is a for each loop, going through all values (the Compose + Current Time + Converttimezone + formatDate Times is just to fix my previous issue with dates formatting).

In this 'Apply to each' loop, one of the columns is the one causing the issue. If i write its name (lets say Analyst) in the Dynamic Content i get:  Analyst, Analyst Item, Analyst Claims, Analyst DisplayName, AnalystEmail, Analyst Picture ... so on.

IF i chose (just) Analyst ... my excel will return [] 

IF i chose any other variant (I am interested in Display name), then the whole 'Apply to each' flow changes by itself by adding a (within) 'Apply to each 2' and changing the AnalystDisplay into value.

I tried doing as per your input (and other solutions on Google) with initializing a variable, compose and other stuff ... all those solutions require me to select Analyst DisplayName (at some point)... as soon as i do that it changes that flow with an Apply to each loop, with value as values.

 

 

1.jpg

 

2.jpg

Anonymous
Not applicable

This is what happens when i select Analyst DisplayName

3.jpg

 

With this error:

santee_0-1656351871016.png

As you can see, by selecting Analyst DisplayName in the Analyst Column .. changed the flow, forcing a new apply to each 3 to appear. I ran it anyways, just so you can see the above error

 

Anonymous
Not applicable

@Anonymous that is normal behaviour with multi-selection columns. To follow my approach, try these steps:

 

  1. Right after the trigger, initialize the string variable varAnalysts.
  2. In the Get Items advanced options, add an ODATA filter Analyst ne null to exclude any items that have no person selected.
  3. Right after the Get Items action, insert a Get Item action and fetch the current record via its ID. This will create an apply to each loop.
  4. Within this apply to each loop, append to string variable and append Analyst DisplayName from dynamic content. Now the multiple names are in one single string, and it won't create another apply to each loop when you use the variable instead of the multiple selections.
  5. Don't forget to clear the variable after your Add a row into a table loop as otherwise it would be cumulative and append all the Analysts in the list, and ensure concurrency of the flow is set to 1.
Anonymous
Not applicable

@Anonymous I think you miss the Initialize Variable and the Get Item steps. Then you use the variable instead of the dynamic value for Analyst DisplayName. 

Beat_0-1656398772891.png

 

Anonymous
Not applicable

At step 2, if i select Analyst then type ne null, it will create an each loop with this error:

santee_0-1656399543830.png

 

If i just type "Analyst ne null", the flow behaves, but still errors out:

santee_1-1656399613907.png

 

At step 4, the moment i select the Analyst DisplayName it does create an each loop

4.jpg

 

Anonymous
Not applicable

@Anonymous the error 'The expression "CG Analyst ne null" is not valid is likely due to the space in the column name. 

Try CG_x0020_Analyst ne null or simply CGAnalyst ne null. If that doesn't work, it's likely that this column name has been changed at some point in time. Go to the SharePoint list, List Settings, edit the column and look at the last parameter of the URL in the browser's address bar, for example

Beat_0-1656401329647.png

Good luck!

Anonymous
Not applicable

I'm back ... with more disappointment ...tried all above, still same 2 issues: data not getting pulled, the moment i select my column in question it creates an each loop (where it was not supposed to). At this point I'm at: if you want to have a remote meeting, I'm up to it

Helpful resources

Announcements

Community will be READ ONLY July 16th, 5p PDT -July 22nd

Dear Community Members,   We'd like to let you know of an upcoming change to the community platform: starting July 16th, the platform will transition to a READ ONLY mode until July 22nd.   During this period, members will not be able to Kudo, Comment, or Reply to any posts.   On July 22nd, please be on the lookout for a message sent to the email address registered on your community profile. This email is crucial as it will contain your unique code and link to register for the new platform encompassing all of the communities.   What to Expect in the New Community: A more unified experience where all products, including Power Apps, Power Automate, Copilot Studio, and Power Pages, will be accessible from one community.Community Blogs that you can syndicate and link to for automatic updates. We appreciate your understanding and cooperation during this transition. Stay tuned for the exciting new features and a seamless community experience ahead!

Summer of Solutions | Week 4 Results | Winners will be posted on July 24th

We are excited to announce the Summer of Solutions Challenge!    This challenge is kicking off on Monday, June 17th and will run for (4) weeks.  The challenge is open to all Power Platform (Power Apps, Power Automate, Copilot Studio & Power Pages) community members. We invite you to participate in a quest to provide solutions to as many questions as you can. Answers can be provided in all the communities.    Entry Period: This Challenge will consist of four weekly Entry Periods as follows (each an “Entry Period”)   - 12:00 a.m. PT on June 17, 2024 – 11:59 p.m. PT on June 23, 2024 - 12:00 a.m. PT on June 24, 2024 – 11:59 p.m. PT on June 30, 2024 - 12:00 a.m. PT on July 1, 2024 – 11:59 p.m. PT on July 7, 2024 - 12:00 a.m. PT on July 8, 2024 – 11:59 p.m. PT on July 14, 2024   Entries will be eligible for the Entry Period in which they are received and will not carryover to subsequent weekly entry periods.  You must enter into each weekly Entry Period separately.   How to Enter: We invite you to participate in a quest to provide "Accepted Solutions" to as many questions as you can. Answers can be provided in all the communities. Users must provide a solution which can be an “Accepted Solution” in the Forums in all of the communities and there are no limits to the number of “Accepted Solutions” that a member can provide for entries in this challenge, but each entry must be substantially unique and different.    Winner Selection and Prizes: At the end of each week, we will list the top ten (10) Community users which will consist of: 5 Community Members & 5 Super Users and they will advance to the final drawing. We will post each week in the News & Announcements the top 10 Solution providers.  At the end of the challenge, we will add all of the top 10 weekly names and enter them into a random drawing.  Then we will randomly select ten (10) winners (5 Community Members & 5 Super Users) from among all eligible entrants received across all weekly Entry Periods to receive the prize listed below. If a winner declines, we will draw again at random for the next winner.  A user will only be able to win once overall. If they are drawn multiple times, another user will be drawn at random.  Individuals will be contacted before the announcement with the opportunity to claim or deny the prize.  Once all of the winners have been notified, we will post in the News & Announcements of each community with the list of winners.   Each winner will receive one (1) Pass to the Power Platform Conference in Las Vegas, Sep. 18-20, 2024 ($1800 value). NOTE: Prize is for conference attendance only and any other costs such as airfare, lodging, transportation, and food are the sole responsibility of the winner. Tickets are not transferable to any other party or to next year’s event.   ** PLEASE SEE THE ATTACHED RULES for this CHALLENGE**   Week 1 Results: Congratulations to the Week 1 qualifiers, you are being entered in the random drawing that will take place at the end of the challenge.   Community MembersNumber SolutionsSuper UsersNumber Solutions Deenuji 9 @NathanAlvares24  17 @Anil_g  7 @ManishSolanki  13 @eetuRobo  5 @David_MA  10 @VishnuReddy1997  5 @SpongYe  9JhonatanOB19932 (tie) @Nived_Nambiar  8 @maltie  2 (tie)   @PA-Noob  2 (tie)   @LukeMcG  2 (tie)   @tgut03  2 (tie)       Week 2 Results: Congratulations to the Week 2 qualifiers, you are being entered in the random drawing that will take place at the end of the challenge. Week 2: Community MembersSolutionsSuper UsersSolutionsPower Automate  @Deenuji  12@ManishSolanki 19 @Anil_g  10 @NathanAlvares24  17 @VishnuReddy1997  6 @Expiscornovus  10 @Tjan  5 @Nived_Nambiar  10 @eetuRobo  3 @SudeepGhatakNZ 8     Week 3 Results: Congratulations to the Week 3 qualifiers, you are being entered in the random drawing that will take place at the end of the challenge. Week 3:Community MembersSolutionsSuper UsersSolutionsPower Automate Deenuji32ManishSolanki55VishnuReddy199724NathanAlvares2444Anil_g22SudeepGhatakNZ40eetuRobo18Nived_Nambiar28Tjan8David_MA22   Week 4 Results: Congratulations to the Week 4 qualifiers, you are being entered in the random drawing that will take place at the end of the challenge. Week 4:Community MembersSolutionsSuper UsersSolutionsPower Automate Deenuji11FLMike31Sayan11ManishSolanki16VishnuReddy199710creativeopinion14Akshansh-Sharma3SudeepGhatakNZ7claudiovc2CFernandes5 misc2Nived_Nambiar5 Usernametwice232rzaneti5 eetuRobo2   Anil_g2   SharonS2  

Check Out | 2024 Release Wave 2 Plans for Microsoft Dynamics 365 and Microsoft Power Platform

On July 16, 2024, we published the 2024 release wave 2 plans for Microsoft Dynamics 365 and Microsoft Power Platform. These plans are a compilation of the new capabilities planned to be released between October 2024 to March 2025. This release introduces a wealth of new features designed to enhance customer understanding and improve overall user experience, showcasing our dedication to driving digital transformation for our customers and partners.    The upcoming wave is centered around utilizing advanced AI and Microsoft Copilot technologies to enhance user productivity and streamline operations across diverse business applications. These enhancements include intelligent automation, AI-powered insights, and immersive user experiences that are designed to break down barriers between data, insights, and individuals. Watch a summary of the release highlights.    Discover the latest features that empower organizations to operate more efficiently and adaptively. From AI-driven sales insights and customer service enhancements to predictive analytics in supply chain management and autonomous financial processes, the new capabilities enable businesses to proactively address challenges and capitalize on opportunities.    

Updates to Transitions in the Power Platform Communities

We're embarking on a journey to enhance your experience by transitioning to a new community platform. Our team has been diligently working to create a fresh community site, leveraging the very Dynamics 365 and Power Platform tools our community advocates for.  We started this journey with transitioning Copilot Studio forums and blogs in June. The move marks the beginning of a new chapter, and we're eager for you to be a part of it. The rest of the Power Platform product sites will be moving over this summer.   Stay tuned for more updates as we get closer to the launch. We can't wait to welcome you to our new community space, designed with you in mind. Let's connect, learn, and grow together.   Here's to new beginnings and endless possibilities!   If you have any questions, observations or concerns throughout this process please go to https://aka.ms/PPCommSupport.   To stay up to date on the latest details of this migration and other important Community updates subscribe to our News and Announcements forums: Copilot Studio, Power Apps, Power Automate, Power Pages

Users online (593)