# Category: Formula

## Data - How to get a row by ordinal number

It's now possible to retrieve records from a table, collection, or data source by ordinal number. The function that provides this functionality is called Index, and this post summarises how it works.

## Formula - What to do when the If statement doesn't work?

A question that arises on occasions is - why doesn't my If statement work? This post walks through one of the most common causes and highlights the possible workarounds.

## Formula - Boolean And / Or operators - What is the order of precedence?

When we construct expressions that include the Boolean And and Or operators, which operator takes precedence? Find out in this post.

## Controls - How to set the data source of a Combo Box to a comma separated string

There may be a need to set the data source of a combo box control to a comma-separated list. This post walks through how to carry out this task.

## Numbers - 10 examples of how to round numbers

When we work with numbers with Power Apps, a common requirement is to round numbers. This post summarises the formula to carry out some of the most common rounding requirements, including how to round to multiples, how to round to values such as 0.5, 0.99, 0.45, how to round to odd/even numbers, and how to return the integer portion of a decimal value.

## Formula - Difference between round, square, and curly brackets

For app builders who are relatively new, the syntax for writing formula can be confusing - perticularly with regards to the use of brackets. This post summarises the bracket types that are available in Power Apps.

## Top 3 highlights of upcoming enhancements to the Power Apps language (Power FX)

Yesterday's Build conference introduced several exciting new enhancements to the Power Apps language.This post summarises the top 3 highlights.

## Email - Sending email attachments with the Office 365 Outlook connector

The syntax to attach files to an email message can be complex. This post describes how to use the Office 365 Outlook connector to send emails with attachments. It covers how to attach files from a SharePoint record, files that a user selects using an attachments control, images, audio recordings, and multiple combinations of files.

## Formula - What to try when numbers don't format correctly

A frustrating problem that app builders sometimes encounter is the inability to format numbers correctly. This post examines what to try if you find yourself in this situation.

## Controls - How to convert HTML to Text

A frequent requirement is to convert HTML to text. This issue arises frequently when app builders attempt to display values from SharePoint rich text columns. This post summarises the methods to display rich text content in Power Apps, and how to convert HTML to text.

## Formulas - how to return all days between two dates

There are some scenarios where we need to return all the days between a given start and end date. This post describes the formula to build a table of sequential, consecutive days.

## Formula - How to create comma separated (CSV) list of items

A common requirement is to build a comma separated list based on items from a data source or collection. This post demonstrates this technique by building a CSV string of selected items from a combo box.

## Formula - How to use the IF and Switch functions - 3 common examples

The two primary functions to carry out conditional operations are If and Switch. The typical questions that arise include - how do I match a value against numeric ranges, a list of acceptable values, or a list of matching conditions? This post highlights the example syntax that we can use.

## Location - Finding the closest location and and sorting records by distance, based on the current location of the user

Given a data source that contains a list of locations, which record matches the location that is nearest to an input location? This is typical challenge we face when we want to build a feature that, for example, returns a list of stores that is sorted in distance relative to the current location of a customer. In this post, we'll walk through the formula that enables us to carry out this calculation.

## Formulas - How to cope with weekends and public holidays in date calculations

Performing date calculations that take working days and public holidays into account can be complicated. This post summarises and verifies the formula to calculate the number of working days between two dates, and the formula to add a given number of working days to a start date.