Forum Discussion

Pn1995's avatar
Pn1995
Brass Contributor
Mar 19, 2019

Auto populate default value

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

  • WinfredLiu's avatar
    WinfredLiu
    Brass Contributor

    Hi Pn1995 

     

    You set the "Ticket Reference" Default field to:

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

     

    That's why when you "Edit" the item, it will show "BAS-" again.

     

    If you want to keep the value when you edit it, you can change the Default to:
    If(
        !IsBlank(Parent.Default),
        Parent.Default,
        DataCardValue4.Selected.Value = "Basingstoke-(BAS)",
        "BAS-",
        "false"
    )

Resources