SQL: Unpivoting Tables

Unpivoting table might be a great way to create filters in PowerApps.

Store you r

Unpivot it using this code:

SELECT [User],[App],[Permission]
FROM   
   (SELECT [User], [App1], [App2], [App3]
   FROM [UserApp]) p  
UNPIVOT  
   (Permission FOR App IN   
      (App1, App2, App3)  
)AS unpvt
WHERE [Permission] = 'Yes'
;  

Store that code to a view to easily retrieve it from your PowerApps.


Leave a Reply

Your email address will not be published. Required fields are marked *