Scenario
We have a datetime column DueDate in a SQL table. I need to display only date version in a label in Power Apps Gallery. Below is the code:
Text(ThisItem.DueDate,"dd-mmm-yyyy")
This will return 11-Jan-2023
We have a datetime column DueDate in a SQL table. I need to display only date version in a label in Power Apps Gallery. Below is the code:
Text(ThisItem.DueDate,"dd-mmm-yyyy")
This will return 11-Jan-2023
There is a SQL Server Table Project_Details with a column Due_Date of type datetime. In Canvas Apps, we have a collection named projectDetailsColl in which we are collecting Projects Details like txtProjectName as Text Input, dtpDueDate as Date Picker. The requirement is to save the values from collection to SQL table.
Below is the code for this:
ForAll(projectDetailsColl,
Patch(Project_Details, Defaults(Project_Details),
{
ProjectName: projectDetailsColl[@ProjectName],
DueDate: DateTimeValue(projectDetailsColl[@DueDate]),
ModifiedBy: User().Email,
ModifiedDate: Today()
})
)
Whenever a user signs up for Power Apps or Dynamics, a new environment is automatically created. This environment will be the default environment.
Below are the steps to create a new environment:
Below is the code I used to compare string values from two Text Inputs. This will not compare the case.
That is, “Apple” will be equal to “apple”.
If(
StartsWith(TextBox1.Text, TextBox2.Text),
"values matched", "Values did not matched"
)
By default, we can display only one field in Combo Box and Search for only one field in Combo Box.
There is a requirement to display multiple fields and also search for multiple fields in Combo Box. For example, we have EmployeeDetails as the Data should display Employee Name and Employee Email ID and can also search the record using same.
Modify below parameters of ComboBox:
Items: EmployeeDetails
DisplayFields: ["EmployeeName","EmployeeEmailID"]
SearchFields: ["EmployeeName","EmployeeEmailID"]
We can use this for ID and Definition Column types as well.
When we want to get the details of latest created or updated item using SubmitForm, we use Form1.LastSubmit
Below is an example of Employee Details table.
SubmitForm(frmEmployeeDetails);
UpdateContext({newItem: frmEmployeeDetails.LastSubmit.ID})
This way, you can also fetch other details of the last submitted record, e.g., frmEmployeeDetails.LastSubmit.Name, frmEmployeeDetails.LastSubmit.Address etc.
Data Loss Prevention (DLP) policies help users to prevent accidently exposing organizational data.
Insert a People Picker in Canvas Power App using Combo Box. Below are the steps: Add Office 365 Users Data Source. Add a Combo Box. Click on Edit Fields on Properties Bar. Select Person as the Layout. To pre-populate the Combo Box with the existing value, write below code in DefaultSelectedItems property. RequestSubmittedByEmail and RequestSubmittedByName […]
To check whether a table in data source is empty or not, use IsEmpty
IsEmpty(tableName)
This is equivalent to CountRows(tableName)=0
We cannot use CountRows() directly on data source as it generally gives Delegation warning (Depends on the Connector)
If IsEmpty(tableName) returns true, this indicates that your Data Source table has no rows.
There are times when we want to add a new line in a text to be displayed in Label.
Use Char(10) to insert a new line in Label like shown below.
Use <br> to insert a new line in HTML Text Input like shown below.