🎯 Power Apps Tip: Disable Choice Field Based on Text Field Value in SharePoint Custom Form

 

🎯 Power Apps Tip: Disable Choice Field Based on Text Field Value in SharePoint Custom Form

Author: powerapps fargo
Scenario: You’re customizing a SharePoint list form using Power Apps. You want the form behavior to be dynamic — if one field is empty, another should reset and become unselectable.

Let’s look at a real-world example to implement this.


πŸ”§ Use Case

You have a SharePoint list called codewarrior with the following two columns:

  • openai – Single line of text

  • gpt – Choice column (dropdown)


🧠 Business Rule

If the openai field is blank, the gpt dropdown should:

  • Be cleared

  • Be disabled (grayed out)

If openai has text, the gpt field becomes active again.


πŸ› ️ Step-by-Step Guide

Let’s walk through how to achieve this in a Power Apps customized SharePoint form.


✅ Step 1: Open the Power Apps Form Customization

  1. Navigate to your SharePoint list codewarrior

  2. From the top ribbon, click:

    • Integrate → Power Apps → Customize forms

  3. Power Apps Studio will launch in a new tab with your list form


✅ Step 2: Rename Controls for Clarity

In Power Apps Studio:

  1. In the left pane (Tree View), expand:

    • FormScreen1SharePointForm1

  2. Rename your key controls:

    • Select the text input inside the openai card → rename it to txtOpenAI

    • Select the dropdown inside the gpt card → rename it to drpGPT

πŸ”„ Renaming helps maintain clean and readable formulas.


✅ Step 3: Make gpt Blank When openai Is Empty

  1. Select the drpGPT control (choice dropdown)

  2. In the top formula bar, set the DefaultSelectedItems property to:

If(
    IsBlank(txtOpenAI.Text),
    Blank(),
    LookUp(Choices(codewarrior.gpt), Value = ThisItem.gpt.Value)
)

✅ This ensures that the gpt field is cleared if the user didn’t type anything in openai.


✅ Step 4: Disable gpt When openai Is Blank

  1. Keep drpGPT selected

  2. In the formula bar, set the DisplayMode property to:

If(
    IsBlank(txtOpenAI.Text),
    DisplayMode.Disabled,
    DisplayMode.Edit
)

✅ This disables the dropdown, preventing users from selecting a value until openai is filled.


✅ Step 5: Auto-Reset gpt When openai is Cleared

  1. Select the txtOpenAI text input

  2. Go to the OnChange property

  3. Add this line:

If(
    IsBlank(txtOpenAI.Text),
    Reset(drpGPT)
)

✅ Now, when a user deletes the text from openai, the gpt choice field will automatically reset to blank.


✅ Step 6: Save and Publish the Custom Form

  1. Click FileSave

  2. Then click Publish to SharePoint

  3. Go back to your SharePoint list and test the form


πŸ§ͺ Result: Intelligent Field Behavior

openai Field gpt Dropdown Behavior
Blank Disabled + Cleared
Has Text Enabled + Shows saved value

✅ Optional Enhancement

You could also display a tooltip or message when the dropdown is disabled:

Tooltip = If(IsBlank(txtOpenAI.Text), "Please fill the 'openai' field first", "")

πŸš€ Final Thoughts

This solution shows how you can create smarter Power Apps forms by linking field behavior together. This reduces user errors and ensures data consistency without writing any code outside Power Apps.

Have more SharePoint + Power Apps automation ideas? Drop them in the comments or reach out!


Comments

Popular posts from this blog

Bridging the Impossible: Connecting Jira On-Prem to Power Automate & Copilot Studio — The Solution Nobody Built Until Now"

How I Automated My Entire SharePoint Tenant with 150 MCP Tools and Claude Desktop

Azure Management MCP Server