Need help in building the solution for one of my apps where I am trying to get the Sumif function with a combination of Search and Combobox result.
I have a label where I am trying to get the result in a number.
Challenges is when i am trying to call the Dropdown in the formula itself, not capturing the Countif function. The result is shown as zero.
But when I placed the hard code input its giving me the result.
Hi @akbarmahfuzalam ,
If I understand your query correctly, you want to filter the collection on the column name selected from the dropdown?
Dynamic column filtering is not supported in PowerApps at the moment. If the number of dropdown choices are limited, your best option is to write an If condition for each selection (or use Switch case). Other option as suggested by @RezaDorrani here is to write a flow to perform the query and send the result back to the PowerApp.
Thanks for the Reply. Have checked the videos for Raza D. I find a bit complicated code. Need a simpler solution for this.
Since I am new to this Platform.
Unfortunattely, what are you trying to do is not working in PowerApps Environment. The CountIf() function expects a "literal" column name, not a string value.
So, my proposal is to transfer your calcutation to a PowerAutomate flow called on OnChange() property of the comboBox where a query inside the GetItems action is more flexible.
Hope it helps !
Yes, you are on the right track.
This is what I was thinking about (of course you need to adapt to your needs using 3 parallel branches, for each of Efficient/Trained/Not Trained, please use single qoutes for strings) . Use parallel branches to reduce the flow running time.
1.is the parameter coming from powerapps and should be like - Combobox.Selected.Value (from what i see the column name).
2. formula is (as you already figured out): length(body('Get_items')['value']
3. formula is similar to point 2 but refering at action Get_items_2.
Also in OnChange property of comboBox from PowerApps use a global / context variable to keep the response from flow like:
and the text from the label under Efficient/Trained/Not Trained will be:
answerFromFlow.countEfficient , answerFromFlow.countTrained and answerFromFlow.countNotTrained.
May be it's not the brightest idea, but it will give you the expected results.
Hope it will be usefull ...
Thanks for the update. I tried to implement the flow but unfortunately I think i missed out something.
1. May be you missed an underline ?
The template validation failed: 'The inputs of template action 'Respond_to_a_PowerApp_or_flow' at line '1 and column '4291' cannot reference action 'Get_items'. Action 'Get_items' must either be in 'runAfter' path or within a scope action on the 'runAfter' path of action 'Respond_to_a_PowerApp_or_flow', or be a Trigger.'.