Set value of a field using PowerFx in a CommandBar

You can set the value of a field within a Command Bar within PowerApps using a formula such as:

Patch(
ShirreyPrindeys,
Self.Selected.Item,
{
Membership: 'Membership confirmation check'.'Is a Member'
}
)

This sets the Membership field, which is a Choice, to the value provided, which is expressed as a property of the choice.

Resolving OAuth errors connecting PowerApp to Twitter

The Microsoft Training Path for the Power Platform has you configuring Sharepoint with neat approval workflows and Twitter. Unfortunately, the Twitter piece can prove challenging with cryptic errors.

It was too easy to just blame Elon Musk’s recent spats for restricting or breaking API access.

When connecting to Twitter’s API, you should set up a Developer account at https://developer.twitter.com and create an Application. Following Musk’s takeover of Twitter, there is a free and a “basic” tier of service. The free tier should suffice for this challenge.

When creating the Application for Twitter, be sure to ensure that the user has Read/Write permission. Take a copy of the API key and secret, before returning to PowerApps.

When configuring the Flow in PowerApps, the Twitter connection will be configured with the settings created in the Application for Twitter.

When configuring the Twitter connection, errors you will get include variations of:

  • ApiConnectionLimitExceeded. Failed to create connection for connection id
  • Create and authorise OAuth connection failed
  • Failed to create connection for connection id

Some errors indicate you have reached the limit for API connections. This indicates that you have more than 2 Connections configured. You should delete at least one and try again.

This Stack Overflow post suggested using the URL https://global.consent.azure-apim.net/redirect for the Callback URL in the Project settings section:

You should select “Bring your own application” for the Application type.

The language is ever so slightly different between PowerApps and Twitter:

PowerApps languageTwitter language
Consumer KeyAPI Key
Consumer SecretAPI Secret

This will create a new Connection, which should work if the above has been configured correctly.