web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / Set Default value for ...
Power Apps
Answered

Set Default value for choice field if it is blank

(0) ShareShare
ReportReport
Posted on by 181

Hi PowerApps Community,

 

I have a canvas app with Edit Form which is connected to a SharePoint list. There is a choice field on the from whose default value needs to be set to one of the choice options if its blank. 

 

It works, when the 'Default" property of the datacard is set to the following expression.

LookUp(Choices('LisName'.'ChoiceFieldName'),Value="DefaultChoiceOption")

The requirement is to set default value only when the field is blank. 

Using if condition to check if the datacardvalue is blank/empty results in "this rule creates a circular reference" error.

 

Looking for help to get the above accomplished. 

 

Thanks,

SV

Categories:
I have the same question (0)
  • Verified answer
    mdevaney Profile Picture
    29,989 Moderator on at

    @sunithav 

    Try this code instead:

     

    If(ThisItem.ChoiceFieldName.Value=Blank(), {Value: "Default Text"}, ThisItem.ChoiceFieldName)

     

    ---
    Please click "Accept as Solution" if my post answered your question so that others may find it more quickly. If you found this post helpful consider giving it a "Thumbs Up."

     

     

  • CU20081036-0 Profile Picture
    181 on at

    @mdevaney, Thanks for the response. I see error "Invalid argument type" in the expression for '=' operator.

  • mdevaney Profile Picture
    29,989 Moderator on at

    @sunithav 

    I have edited my code above to include .Value.  Please try it instead.

     

    ---
    Please click "Accept as Solution" if my post answered your question so that others may find it more quickly. If you found this post helpful consider giving it a "Thumbs Up."

  • CU20081036-0 Profile Picture
    181 on at

    @mdevaney, That worked like a charm. Thank you very much.   

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 739 Most Valuable Professional

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 343 Super User 2025 Season 2

#3
Power Platform 1919 Profile Picture

Power Platform 1919 268

Last 30 days Overall leaderboard