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

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / Auto populate default ...
Power Apps
Answered

Auto populate default value

(0) ShareShare
ReportReport
Posted on by 46

Hi

We have a drop down field were user can select a location

 

We then have a another field for a ticket reference were depending on the location select, a code is entered is automatically populated and the user is then allowed to add to this eg

 

Location DropDown has the option "Basingstoke-(BAS)", Other options

Ticket referernce would automatically add "BAS-" (because Basingstoke-(BAS) was selected in Location

 

User can then append to BAS- with a reference number, thus making the "Ticket Reference" "BAS-1234"

 

We have in the "Ticket Reference" Default field this formula...


If(DataCardValue4.Selected.Value="Basingstoke-(BAS)","BAS-","false")

 

This work fine, as saves ok into a SharePoint List.

 

However when you "Edit" the form again it loses the saved data (eg BAS-1234) and reverts back to "BAS-"

 

Any idea how to get the Edited form to keep the data that is saved?

 

Thanks

 

Categories:
  • Verified answer
    RandyHayes Profile Picture
    76,299 Super User 2024 Season 1 on at

    @pn1995 

    Your issue is in the Default property.  You need to check to see if the form is in New mode or Edit mode.

    If it is in New mode, then you want the formula you have to function.

    If it is in Edit mode, then you want to use the value in the data column.

     

    If(yourForm.Mode=FormMode.New, 
     If(DataCardValue4.Selected.Value="Basingstoke-(BAS)","BAS-","false"),
    Parent.Default
    )

    Of course - I'm a little suspect on the If statement you have now.  This will say that the default value will be "BAS-" or "false".  Not sure that's what you want.

    But, this will help you display the actual field value when you are not in New mode (i.e. Display and Edit)

     

    I hope this is helpful for you.

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

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Leaderboard > Power Apps

#1
11manish Profile Picture

11manish 396 Super User 2026 Season 2

#2
Mohsin Ali Profile Picture

Mohsin Ali 323

#3
WarrenBelz Profile Picture

WarrenBelz 193 Most Valuable Professional

Last 30 days Overall leaderboard