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 / Updating a SharePoint ...
Power Automate
Unanswered

Updating a SharePoint list to increment number of absences

(0) ShareShare
ReportReport
Posted on by 546

Hi everyone,

I have a flow that runs when someone creates an absence form.  Works great.  It routes a bunch of status changes to people.

 

Now I'm adding a new feature, and I've created a second list which acts as a counter for a person.

It's meant to be a running tally of how many times the person has been absent during the year.  Not the number of days, but the number of times they've completed the form.

 

The flow runs like this currently.  When the LOA form is completed in list 1 - Short Term LOA, check my tally list to see if the person has an absence for this year. 
If they do exist in the list, then add 1 to the number.

If they don't exist in the list, the create a new item.

I have two sticking points. 

The first is for my get items action, I'd love an Odata filter to match the person who filled out the form with the people in the tally list, which is not a show stopper if I can't make that happen.  When I put in the OData filter Studentname eq 'strStudentName' it doesn't find any values.

 

The second, which is the problem, my logic.  It creates duplicates of the person in the tally list.

I'll stop typing and put in screen shots.

smorley_0-1686232630926.png

smorley_1-1686232723702.png

smorley_2-1686232875825.png

 

Categories:
I have the same question (0)
  • annetoal Profile Picture
    1,934 Moderator on at

    Questions: is the Absences variable ever going to be anything other than a whole number? If you don't need decimals, then initialize it as an integer.

    Can you show what's inside the Create item step? Also the output of that step? It seems like you ought to move that module earlier in the Flow so that the new item has been created by the time you're testing the user names. The fact that you're creating a new item even when the person's name already exists suggests that the test happening at the wrong place, or perhaps the variable and the string in SharePoint are not truly identical, so they're never going to satisfy the condition.

     

    If this helped, please mark it as a solution.

    Anne

  • smorley Profile Picture
    546 on at

    I actually started with integer, but in the SharePoint list the field is a number, with 0 decimals, and when I used integer Power Automate gives me a data mismatch error, so I changed the variable to floating so that much works.

  • smorley Profile Picture
    546 on at

    Here's the create item step:  

    smorley_0-1686234009233.png

     

  • annetoal Profile Picture
    1,934 Moderator on at

    What's the output of the variable compared to the output of the name field in sharePoint? Is it truly identical?

  • smorley Profile Picture
    546 on at

    I have more information.  I deleted all the items in the tally list and rerun the workflow.  My get items action has no filters on, and now the apply to each action with the condition in it doesn't run at all.
     

    smorley_0-1686235410999.png

     

  • annetoal Profile Picture
    1,934 Moderator on at

    Looks like it didn't even run the Apply to each. Why not undo the changes you made, one at a time, and then do a test run each time, to see which one causes the Flow to start running again. That might give you some clues as to why that happened.

    What filter did you use?

    What's the output of the variable compared to the output of the name field in sharePoint? Is it truly identical?

     

  • smorley Profile Picture
    546 on at

    What I am doing now is putting an OData filter query based on Tom Riha's solution for people fields.

    I'm getting a bad request error when I do so.

    smorley_0-1686246456685.png

    My plan is, that if the get item action fails, I'll do a configure run after and create the item, and then if it passes, I'll update the item with another configure run after condition, if the create item is skipped.

     

    Because the Odata filter action isn't working, the thing is blowing up.  

    smorley_1-1686246571094.png

     

  • annetoal Profile Picture
    1,934 Moderator on at

    There's no closing quote mark on your email address showing in the ODATA filter. Try it with the second ' mark after dal.ca

    Please make sure the column name is exactly as is shown in your SharePoint's internal column name. Sometimes the internal name is mixed up with the display name. It might not be different, but please confirm.

  • smorley Profile Picture
    546 on at

    Yes you're absolutely right, and I saw it as soon as I posted.  Sadly, once I changed it to being correct, I get the same bad request error, which makes me wonder if there is a problem with the list.  It's odd though, there are only a few fields.

     

    The error is: One or more field types are not installed properly. Go to the list settings page to delete these fields.

     

    Maybe creating a new list and trying it again is the next step.

     

    Happy Friday!

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 523 Super User 2025 Season 2

#2
Tomac Profile Picture

Tomac 406 Moderator

#3
abm abm Profile Picture

abm abm 245 Most Valuable Professional

Last 30 days Overall leaderboard