web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Automate / Check if a field exist...
Power Automate
Unanswered

Check if a field exists in Sharepoint list

(0) ShareShare
ReportReport
Posted on by 42

Hi guys

 

I'm creating a Flow which is checking around 100 SharePoint lists in a site to get a number of list items that have been "validated" and update a Spreadsheet - this is now working perfectly thanks to some help on here and from Google.

 

However, there's one part that I can't get, and I'm not sure why. Each of the lists I'm looking for has a field called "AssignedUser" - this user is the same for every item in the list. So I created a Compose with the following input: first('Get_Items')?['AssignedUser']

 

But doing this seems to break everything. My initial thought is it could be because not every list has this field? If that's the reason, is it possible to have a kind of 'IFERROR' Excel-type logic to ignore these lists completely and skip to the next? Or am I just using the 'first' function incorrectly?

 

Thanks for any help in advance!

Categories:
I have the same question (0)
  • sudharsan1985 Profile Picture
    1,325 on at

    Hi @brokencornets 

    You can check whether the field is there in the lists or not using the flow. There is no direct out-of-box action to check but you can use the SharePoint REST API to check whether the field is available in the lists or not.

    sudharsan1985_0-1600265190097.png

    I had changed the name of the action to 'Check List Field', use the below expression in the 'Condition' action to check for the length, in the 'Yes' block do the action if the field is present, and in the 'No' block do the actions if any.

    length(outputs('Check_List_Field')?['body']?['d']?['results'])

     

    Hope it helps, please like it or mark it as a solution if it resolves your clarification or issue
    -Sudharsan K...

  • brokencornets Profile Picture
    42 on at

    Hi Sudharsan

     

    Thanks for your help - I've now managed to set up a condition to only bring back the lists that contain the AssignedUser field, but it seems like I'm using the 'first' function wrong as it's still breaking at this point.

     

    How would I go about bringing back the data from the AssignedUser field in the first item (or any item) of the list?

     

    I try:

    first(body('Get_Items')?['AssignedUser'])
    first('Get_Items')?['AssignedUser']
    first(body(‘Get_Items')?['Value'])?['AssignedUser']
    body(‘Get_Items')?['Value']?[0]?['AssignedUser']
     
    but nothing is working 😞
     

     

     

  • sudharsan1985 Profile Picture
    1,325 on at

    Hi @brokencornets 

    I assume that its a Multi People Picker field. Use the 'Apply to each' action with the following condition. I just used from the triggerBody output, you can use the same with the other outputs.

    triggerOutputs()?['body/AssignedUsers']

    Inside the loop use the below condition. Here I took the user's email address.

    items('Apply_to_each')?['Email']

     

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

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Automate

#1
Michael E. Gernaey Profile Picture

Michael E. Gernaey 519 Super User 2025 Season 2

#2
Tomac Profile Picture

Tomac 296 Moderator

#3
abm abm Profile Picture

abm abm 232 Most Valuable Professional

Last 30 days Overall leaderboard