Dear All, I am trying to filter a gallery based on a lookup field.
Lookup field contains plant code. My objective is users should see the entries belonging to their plant. Users should not see other plants records. I tried to write below formula but did not work. Can i ask you support on this?
Solved! Go to Solution.
Hi @Ogun_ustun
Your formula for filtering is incorrect. You failed to identify the Field in the datasource that is equal to DataCardValue2_1.Text. If the column in your datasource is PlantSAPcode then the formula should be something like
Sort( Filter(TransferOrderNumberApplication,PlantSAPCode=DataCardValue2_1.Text), 'Order Date', Descending)
Also, there is no need to have two separate formulas for sorting and filtering. PowerApps executes functions from the inside out. In this case, the datasource will be filtered first and then sorted.
Hi@Ogun_ustun,
Based on the issue you mentioned, you want to filter the specified entries.
It seems that something is wrong with your formula. ‘TransferOrderNumberApplication’ is your data source name, and DataCardValue2_1 is a control in your app which can’t be referred to in your data source. What‘s more, you should refer to your corresponding column in your data source.
Please try to modify your formula like this:
Sort (Filter(TransferOrderNumberApplication,'Plant SAP Code '.Value="MA11"),OrderDate,Descending)
Replace the “MA11” with Plant SAP Code value within your Detail form. You may need to use the following formula to reference the Plant SAP Code value:
DataCardValue2_1.Selected.Value
Note
Best Regards,
Qi Qiao
Hi @Ogun_ustun
Your formula for filtering is incorrect. You failed to identify the Field in the datasource that is equal to DataCardValue2_1.Text. If the column in your datasource is PlantSAPcode then the formula should be something like
Sort( Filter(TransferOrderNumberApplication,PlantSAPCode=DataCardValue2_1.Text), 'Order Date', Descending)
Also, there is no need to have two separate formulas for sorting and filtering. PowerApps executes functions from the inside out. In this case, the datasource will be filtered first and then sorted.
Hi@Ogun_ustun,
Based on the issue you mentioned, you want to filter the specified entries.
It seems that something is wrong with your formula. ‘TransferOrderNumberApplication’ is your data source name, and DataCardValue2_1 is a control in your app which can’t be referred to in your data source. What‘s more, you should refer to your corresponding column in your data source.
Please try to modify your formula like this:
Sort (Filter(TransferOrderNumberApplication,'Plant SAP Code '.Value="MA11"),OrderDate,Descending)
Replace the “MA11” with Plant SAP Code value within your Detail form. You may need to use the following formula to reference the Plant SAP Code value:
DataCardValue2_1.Selected.Value
Note
Best Regards,
Qi Qiao
User | Count |
---|---|
183 | |
124 | |
88 | |
45 | |
42 |
User | Count |
---|---|
248 | |
159 | |
127 | |
78 | |
73 |