Skip to main content

Notifications

Power Automate - Building Flows
Answered

Approval rejections - pulling data from an array

(0) ShareShare
ReportReport
Posted on by 34
Hi folks
 
Here's the scenario:
I'm in the process of automating onboarding of new staff (and learning much as I go).
 
 
 
  1. A csv comes via email from HR team with name/job title/start date etc of new staff members.
  2. My flow extracts the data from the csv and puts it into an array


     
  3. Within an 'Apply to Each', an approval is started for each of the new starters. One of my team casts their eye over it to make sure no typo's or errors anywhere.
  4. If approved, a new item is added to a SharePoint List, showing name (Test One)/start date etc.


     
  5. If Rejected, I'm creating a HTML table to hold the name (Test One from screenshot above highlighted yellow) of the staff member.
  6. This table is then sent via email to my team and HR to advise there's something wrong with this particular staff members details.
The part I'm stuck on - I can't get the name out of the array to put into the HTML table.
 
 
 
I tried doing the same as I did for adding the values to the SharePoint List (which works fine), but when I try this in the HTML table (or even directly into an email) I get an error that it's expecting a string, not an object.
 
split(item(),',')?[1]
 
 
 
 
Anyone know how I get just the name (Test One from the screenshot above highlighted yellow) into my table?
 
Thanks in advance
  • LydonNZ Profile Picture
    LydonNZ 34 on at
    Approval rejections - pulling data from an array
    Thank you!!!
     
    Oh my, I spent an entire day trying all kinds of different ways to get that to work. 
    Still so much to learn about Power Automate but loving it.
     
    Thanks again, much appreciated :-)
  • Verified answer
    NickWarner Profile Picture
    NickWarner 113 on at
    Approval rejections - pulling data from an array
    If you just reused the code split(item(),',')?[1] in your HTML table, then that might be where you are going wrong as the item() part of that code will be referring to the Responses output.
     
    Try split(items('Apply_to_each'),',')?[1] to refer to the current array item.
     
  • LydonNZ Profile Picture
    LydonNZ 34 on at
    Approval rejections - pulling data from an array
    Hi Mira, thanks for taking a look at this.
     
    Here's the approval from the flow, and what gets sent through to Teams for approval.
     
     
     
     
     
     
    Here's a link to download my .csv file.
    Sorry, can't see anywhere to upload it on this post.
     
  • Mira Ghaly Profile Picture
    Mira Ghaly 11,409 on at
    Approval rejections - pulling data from an array
    Can you please share the inputs to this step ?
    if you can as well upload a sample of your CSV file to try from my end ?

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Microsoft Kickstarter Events…

Register for Microsoft Kickstarter Events…

Announcing Our 2025 Season 1 Super Users!

A new season of Super Users has arrived, and we are so grateful for the daily…

Announcing Forum Attachment Improvements!

We're excited to announce that attachments for replies in forums and improved…

Leaderboard

#1
WarrenBelz Profile Picture

WarrenBelz 145,445

#2
RandyHayes Profile Picture

RandyHayes 76,287

#3
Pstork1 Profile Picture

Pstork1 64,741

Leaderboard