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.'.
I figured it out, I had one too many Apply to each steps here is the correct flow
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:
On the Apply to Each 2 I get this error:
Hi, I have Get Items 2: values as my output
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?
This is the error I get on the Apply to each-Check Spot Filled Status step
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"
}
]
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())}'
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.
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.