Use case: students earn classroom money. Their transactions are recorded in one table, and another table called 'Bank' calculates a total balance. I am able to send out an email with a summary of everyone's balances (see image below).
My steps:
Problem: I want to filter the students based on their classroom, then email each teacher only data for their class. Currently I can only send out the whole thing as I'm testing out the Flow.
I tried the filter data operation two ways:
Questions:
I imagine I could execute more of the filter from within PowerApps, but I would like to shift this operation to a recurrence so that it is automated.
Any help is appreciated.
_
Solved! Go to Solution.
Hi @mr-dang,
Could you please share a full screenshot of your flow's configuration?
Could you please show a bit more about your Google Excel table?
Further, do you want to filter records based on classroom?
I have created a Google Excel table on my side and the data structure of it as below:
I assume that you want to filter records whose Class is equal to 1, please take a try with the following workaround:
@equals(item()?['Class'], '1')
item()?['Student_x0020_Name']
The key of second entry set to Current Balance and the corresponding value set to following formula:
item()?['Current_x0020_Balance']
The key of third entry set to Class and the corresponding value set to following formula:
item()?['Class']
Note: The Student Name, Current Balance and Class are columns in my Google sheet, on your side, you could get the column value within your Google sheet with following formula:
item()?['ColumnNameInYourGoogleSheet']
If there is a space within the column name, you must replace the space with '_x0020_' within above formula (WDL expression).
Image reference:
The flow works successfully as below:
More details about using expression in flow actions, please check the following article:
https://flow.microsoft.com/en-us/blog/use-expressions-in-actions/
Best regards,
Kris
Hi @mr-dang,
Could you please share a full screenshot of your flow's configuration?
Could you please show a bit more about your Google Excel table?
Further, do you want to filter records based on classroom?
I have created a Google Excel table on my side and the data structure of it as below:
I assume that you want to filter records whose Class is equal to 1, please take a try with the following workaround:
@equals(item()?['Class'], '1')
item()?['Student_x0020_Name']
The key of second entry set to Current Balance and the corresponding value set to following formula:
item()?['Current_x0020_Balance']
The key of third entry set to Class and the corresponding value set to following formula:
item()?['Class']
Note: The Student Name, Current Balance and Class are columns in my Google sheet, on your side, you could get the column value within your Google sheet with following formula:
item()?['ColumnNameInYourGoogleSheet']
If there is a space within the column name, you must replace the space with '_x0020_' within above formula (WDL expression).
Image reference:
The flow works successfully as below:
More details about using expression in flow actions, please check the following article:
https://flow.microsoft.com/en-us/blog/use-expressions-in-actions/
Best regards,
Kris
how would this work if the class ("1", "2", etc.) was actually the email address of the teacher, and this email address was in the source table being queried? The goal being how to simply iterate over each email address and summarize just those applicable rows into the html table that is sent out in email, and not "hard code" assumptions into the Flow logic about how many classrooms (or email targets) there will be?
I'm new, and trying to adapt this post into my similar use case of grabbing a subset of rows from an Excel sheet and emailing them as an html table to the owner (in a single email, not 1 email for each row.) Like a "group by email" expression.
Hello, I am facing error with my filter condition . i am receiving below error
InvalidTemplate. The execution of template action 'Filter_array_2' failed: The evaluation of 'query' action 'where' expression '@equals(item()?['adname'], items('Apply_to_each')['name'])' failed: 'The template language expression 'equals(item()?['adname'], items('Apply_to_each')['name'])' cannot be evaluated because property 'adname' cannot be selected. Property selection is not supported on values of type 'String'. Please see https://aka.ms/logicexpressions for usage details.'.
@v-xida-msft
Hey Kris,
your solution looks very good but I have the same question like @RobWickham. How do you work with the filter array if your table is dynamic. In your case you compared the values in column "class" to a specific number. What if I want to create a table for each number and I don't want to build a single flow for every of these numbers. I'm facing this problem right now because unfortunately it doesn't work if I just put dynamic content on both sides of this comparison in the filter array.
Best regards
Timo
Join digitally, March 2–4, 2021 to explore new tech that's ready to implement. Experience the keynote in mixed reality through AltspaceVR!
Power Platform release plan for the 2021 release wave 1 describes all new features releasing from April through September 2021.
User | Count |
---|---|
88 | |
58 | |
42 | |
37 | |
36 |
User | Count |
---|---|
84 | |
72 | |
60 | |
56 | |
40 |