Skip to main content

Notifications

Power Automate - Building Flows
Answered

Updating SharePoint List: Volunteer Count

(0) ShareShare
ReportReport
Posted on by 239

Hi, 

 

I have a SharePoint list that I am using to limit volunteer sign ups. Where I have hit a snag is updating the 'Spots Filled' field for the opportunity. I tried using the add expression, but it didn't work. I get this error message: 

 

InvalidTemplate. Unable to process template language expressions in action 'Update_item' inputs at line '0' and column '0': 'The template language function 'add' expects its first parameter to be an integer, a float or a decimal number. The provided value is of type 'Object'. Please see https://aka.ms/logicexpressions#add for usage details.'.

 

 

SharePoint list DOP.jpg

DOP-Flow.jpg

  • GF-02121351-0 Profile Picture
    GF-02121351-0 239 on at
    Re: Updating SharePoint List: Volunteer Count

    I figured it out, I had one too many Apply to each steps here is the correct flow

    Screenshot 2023-01-13 103256.png

  • GF-02121351-0 Profile Picture
    GF-02121351-0 239 on at
    Re: Updating SharePoint List: Volunteer Count

    Hi @Expiscornovus 

     

    Here is the json: 

    json(outputs('Get_response_details')?['body/ra1ee0e2e344746208dc49b5eed78d932'])

    Both Values= the list of items in the list from the Get Items 2 Step

     

     

     

    Here are screenshots from the flow: 

    Screenshot 2023-01-13 091632.png

    Screenshot 2023-01-13 091710.png

     

  • GF-02121351-0 Profile Picture
    GF-02121351-0 239 on at
    Re: Updating SharePoint List: Volunteer Count

    On the Apply to Each 2 I get this error: 

    ActionFailed. An action failed. No dependent actions succeeded.
  • GF-02121351-0 Profile Picture
    GF-02121351-0 239 on at
    Re: Updating SharePoint List: Volunteer Count

    Hi, I have Get Items 2: values as my output 

     

    Screenshot 2022-12-28 122345.png

  • Expiscornovus Profile Picture
    Expiscornovus 31,144 on at
    Re: Updating SharePoint List: Volunteer Count

    Hi @gfeldhake,

     

    What did you use in the Select an output from previous steps field? Can you share the expression you used in that field or share a screenshot of the configuration of the action (in edit mode).


    The error suggest that the answer is a string and not an array. Did you keep the json function around the outputs of the question?

  • GF-02121351-0 Profile Picture
    GF-02121351-0 239 on at
    Re: Updating SharePoint List: Volunteer Count

    This is the error I get on the Apply to each-Check Spot Filled Status step

     
    ExpressionEvaluationFailed. The execution of template action 'Apply_to_each-Check_Spots_Filled_Status' failed: the result of the evaluation of 'foreach' expression '@items('Apply_to_each-Get_SharePoint_List_Items')' is of type 'String'. The result must be a valid array.
  • GF-02121351-0 Profile Picture
    GF-02121351-0 239 on at
    Re: Updating SharePoint List: Volunteer Count

    I added the trim and it still did not match.  

    Here is the output: 

    [
     {
     "@odata.etag": "\"8\"",
     "ItemInternalId": "1",
     "ID": 1,
     "Title": "Day of Play 01.21.22",
     "Opportunity": "Setup (3) 9:00a-10:30a",
     "TotalSpots": 3,
     "SpotsFilled": 0,
     "Modified": "2022-12-21T19:10:32Z",
     "Created": "2022-12-19T15:44:24Z",
     "Author": {
     "@odata.type": "#Microsoft.Azure.Connectors.SharePoint.SPListExpandedUser",
     "Claims": "i:0#.f|membership|EMail",
     },
     "Author#Claims": "i:0#.f|membership|EMAIL",
     "Editor": {
     "@odata.type": "#Microsoft.Azure.Connectors.SharePoint.SPListExpandedUser",
     "Claims": "i:0#.f|membership|EMAIL",
     "DisplayName": "Gfeldhake",
     },
     "Editor#Claims": "i:0#.f|membership|EMAIL",
     "{Identifier}": "Lists%252fDay%2bof%2bPlay%2bVolunteer%2bCounts%252f1_.000",
     "{IsFolder}": false,
     "{Thumbnail}": {
     "Large": null,
     "Medium": null,
     "Small": null
     },
     "{Link}": "https://elchc.sharepoint.com/sites/ResourceDevelopment/_layouts/15/listform.aspx?PageType=4&ListId=1a824f9f%2D2d94%2D4fb0%2D8eb6%2Def7098de6ac5&ID=1&ContentTypeID=0x0100649EEB77C71DEF45A4A0786CB2530FC900B26AF9EBFF8F504391B57A8BF1E7F1D7",
     "{Name}": "Day of Play 01.21.22",
     "{FilenameWithExtension}": "Day of Play 01.21.22",
     "{Path}": "Lists/Day of Play Volunteer Counts/",
     "{FullPath}": "Lists/Day of Play Volunteer Counts/1_.000",
     "{HasAttachments}": false,
     "{VersionNumber}": "8.0"
     }
    ]

     

     

     

  • Verified answer
    Expiscornovus Profile Picture
    Expiscornovus 31,144 on at
    Re: Updating SharePoint List: Volunteer Count

    Hi @gfeldhake,

     

    Can you click the Click to download link in the Get Items 2 action? I expect it is empty and it has not found a match.

     

    I also see the answer ends with a leading whitespace character just before the closing ' character. This might be a reason why it does not match with the Opportunity field.

     

    I would suggest to use a trim function to avoid that.

     

    Opportunity eq '@{trim(item())}'

     

    clicktodownload.png

     

     

  • GF-02121351-0 Profile Picture
    GF-02121351-0 239 on at
    Re: Updating SharePoint List: Volunteer Count

    I think it is working, but now the in the Apply to Each that updates the list and sends the emails will not run. 

    It says that it ran successfully, but the Apply to Each steps are grayed out. I tried rebuilding the flow but that didn't work. 

     

    Web capture_21-12-2022_15296_make.powerautomate.com.jpeg

  • Expiscornovus Profile Picture
    Expiscornovus 31,144 on at
    Re: Updating SharePoint List: Volunteer Count

    Hi @gfeldhake,

     

    You can retrieve the question id by using a peek code in an action where you used the question. You could add a compose action just before the apply to each and copy it from there.

     

    Below is an gif (click on it to see it in high resolution) with a couple of steps on how to retrieve the question id of your specific question.

     

    getquestionidforms.gif

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,666

#2
RandyHayes Profile Picture

RandyHayes 76,287

#3
Pstork1 Profile Picture

Pstork1 64,996

Leaderboard