I have a flow that gets new responses from a MS Forms and transfers the answers into a master spreadsheet in team. The nest morning another flow goes into the master file and pull the responses from the last 24 hours. It works on day one but the following day it creates a new file with answers provided almost 2 days ago. I think the issue is that the filter does not include an "apply to each". I tried fixing it but now the filters does not work at all.
Original code:
@greater(formatDateTime(item()?['Completion time'], 'yyyy-MM-dd hh:mm:ss z'), addToTime(formatDateTime(utcNow(), 'yyyy-MM-dd hh:mm:ss z'), -28, 'Hour', 'yyyy-MM-dd hh:mm:ss z'))
New code (not working):
@greater(formatDateTime(item('Apply_to_each')?['Completion time'], 'yyyy-MM-dd hh:mm:ss z'), addToTime(formatDateTime(utcNow(), 'yyyy-MM-dd hh:mm:ss z'), -28, 'Hour', 'yyyy-MM-dd hh:mm:ss z'))
Error received:
InvalidTemplate. The execution of template action 'Filter_array' failed: The evaluation of 'query' action 'where' expression '@greater(formatDateTime(item('Apply_to_each')?['Start time'], 'yyyy-MM-dd hh:mm:ss z'), addToTime(formatDateTime(utcNow(), 'yyyy-MM-dd hh:mm:ss z'), -28, 'Hour', 'yyyy-MM-dd hh:mm:ss z'))' failed: 'The template language function 'item' must not have any parameters.'.