Showing posts with label PowerApps. Show all posts
Showing posts with label PowerApps. Show all posts

Wednesday, July 20, 2022

Powerapps : How to Set the Visible Property Dynamically

 This post is to show how to set the visible property dynamically

Set the Visible Property of the button to a Boolean variable as below 




Set the dynamic value using the UpdateContext.

UpdateContext({buttonVisible:!buttonVisible})

or use can use one of the below:

UpdateContext({buttonVisible:true})
UpdateContext({buttonVisible:false})



Reference: UpdateContext function in Power Apps




Feel free to point out if anything is wrong/missing in this post.



Powerapps : How to Set the Color of a Button/Label Dynamically

This post is to show how to change the color of a Text / Label / Button etc.. dynamically

We can set the text color by specifying the color in the color attribute, if we want to set the color with a static value.

ex:- 


But if you want to set the value dynamically, we can use a variable. But in this case we will have to use the ColorValue() function to achieve the expected result.

In the below example, on the button click, I am setting the dynamic variable to the value from the text box

Set(labelColor,TextInput1.Text)



Set the Color attribute on the label to 

ColorValue(labelColor)





Result



Reference: Color enumeration and ColorFade, ColorValue, and RGBA functions in Power Apps




Feel free to point out if anything is wrong/missing in this post.




Sunday, June 27, 2021

Power Apps: Searching and Sorting on Gallery with Choice column

This post is to show how to do the search and sort on a power apps gallery using a Choice Field.

In this example I am using  Microsoft/Sharepoint List as the data source. I have added one Choice Column into the list  'ChoiceCol', with the values as shown below.


Create a Power App using the default Integration.


Once the apps is created, to use the Choice column as the Search field and sort field, we need to modify the Items property of the Gallery.


The default value is as below. This will do the Search and Sort based on the Title field.
SortByColumns(Filter([@AJList]
                      ,StartsWith(Title, TextSearchBox1.Text)
                    )
              , "Title", If(SortDescending1, Descending, Ascending)
             )


To make the Search based on the Choice column, we can modify the value as below.

Change Title to ChoiceCol.Value

SortByColumns(Filter([@AJList]
                     ,StartsWith(ChoiceCol.Value, TextSearchBox1.Text)
                    )
              , "Title", If(SortDescending1, Descending, Ascending)
             )





To make the Sort based on the Choice column, we can modify the value as below. Basically add a new column to the table (using AddColumns) with a new name and the values from the Choice field and then specify the newly added column as the column for sorting.
SortByColumns(AddColumns(Filter([@AJList]
                                 , StartsWith(ChoiceCol.Value, TextSearchBox1.Text))
                         ,"SortChoiceCol",ChoiceCol.Value)
              ,"SortChoiceCol", If(SortDescending1, Descending, Ascending)
             )
I have added one more record to show that the Sorting is working based on the Choice Column.




Feel free to point out if anything is wrong/missing in this post.

Azure APIM : How to configure Azure APIM to call a REST API with OAuth Authentication

  In my project, we had a requirement to call a REST API using OAuth Authentication from Azure LogicApps.  We had configured APIM to do the ...