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 / PowerApps forumula to ...
Power Apps
Answered

PowerApps forumula to show selection on display and edit forms

(1) ShareShare
ReportReport
Posted on by 12
 

Hello,

I have a form on SharePoint online that I am trying to customize. It is a person field that needs to be limited to a certain set of individuals. Here is my setup so far (the variables exist in the SharePoint integration onNew, onEdit and onView.

The data gets saved as I can see it in my allitems view. However, when I open an item on, the value does not show on the display nor edit forms in this field. Can someone please assist with how I can fix this?

Formula

Items field:

YAML
Distinct(PO_Requestors,Requestor.DisplayName)


Update:

SQL
Coalesce(DataCardValue4.Selected, varDynamicPerson)

DefaultSelectedItems:

SQL
If(
    SharePointForm1.Mode = FormMode.New,
    Table(varDynamicPerson),
    Table(Coalesce(varDynamicPerson, varFormRecord.Requestor))
)
Categories:
I have the same question (0)
  • Kushal_M Profile Picture
    296 Super User 2026 Season 1 on at
    Hello  
     
    Person column expects a full person record, not just a display name, and the ComboBox's DefaultSelectedItems must match the structure of the records in the Items property.
     

    Could you also share:

    • Whether Requestor is a single-person or multi-person SharePoint column?
    • The exact formula for varDynamicPerson.
    • Whether DataCardValue4 is a ComboBox generated by the SharePoint form or a custom ComboBox?

    Those details will make it easier to pinpoint the exact fix. 

    If your ComboBox Items are only display names, then DefaultSelectedItems must also return records in the form:
    Table(
        {
            Result: varFormRecord.Requestor.DisplayName
        }
    )
    rather than the full person record.
     
    Recommended approach Instead of using Distinct(), use a table of full person records.
     
    For example:
    Items = PO_Requestors
    or
    Items = ShowColumns(
        PO_Requestors,
        "DisplayName",
        "Email",
        "Claims"
    )
     
    Then set: DefaultSelectedItems =
    If(
        SharePointForm1.Mode = FormMode.New,
        Table(varDynamicPerson),
        Table(varFormRecord.Requestor)
    )
     
    and
    Update =
    Coalesce(
        DataCardValue4.Selected,
        varDynamicPerson
    )
    This keeps the same record structure throughout. Another thing to verify. Check what is actually stored in: varFormRecord.Requestor
    Add a label temporarily: JSON(varFormRecord.Requestor, JSONFormat.IndentFour) and compare it to: JSON(DataCardValue4.Selected, JSONFormat.IndentFour). If the structures differ, the ComboBox will not display the value even though SharePoint saves it correctly.
     
    🏷️ Please tag me @Kushal_M, if you still have any queries related to the solution or issue persists.
    ❤️ Please consider giving it a Like, If the approach was useful in other ways.
     Please click Accept as solution if my post helped you solve your issue and help others who will face the similar issue in future.
  • Suggested answer
    vipuljain03 Profile Picture
    701 Super User 2026 Season 1 on at
    The reason the value is not showing up on your Display or Edit forms is a structural mismatch. SharePoint Person columns expect a full person record (including Claims, DisplayName, Email, etc.), but your Items property is currently extracting just a text list of names via Distinct(). Because of this, the DefaultSelectedItems property cannot map the saved record back to the dropdown items.
     
    1. Update the Items property: Instead of Distinct(), use ShowColumns to filter down to the unique columns while retaining the record structure.
    ShowColumns(
        PO_Requestors,
        "DisplayName",
        "Email",
        "Claims"
    )
    2. Your logic/code in the DefaultSelectedItems property is correct, it just needs the underlying data structure to match (which will happen once you update the Items property with the correct formula).
    3. Ensure the ComboBox SearchField is set to: "DisplayName" and SelectMultiple is false (if it is a single-person column).
     
    =========================
    If this reply helped you, please mark this reply as suggested answer ✔️ and give it a like to help others in the community find the answer too! Thanks,
    Vipul
  • Verified answer
    WarrenBelz Profile Picture
    155,838 Most Valuable Professional on at
    As you are writing back to a Person field, what I believe you need to do is to have the full Person record available in the Items of the Combo Box. Your requirement for Distinct value has complicated this a bit, however you can do it as below.
    DropColumns(
       RenameColumns(
          AddColumns(
             AddColumns(
                Distinct(
                   PO_Requestors,
                   Requestor.DisplayName
                ),
                _Record,
                LookUp(
                   PO_Requestors,
                   Requestor.DisplayName = Value
                ).Requestor
             ),
             Email,
             _Record.Email,
             Claims,
             "i:0#.f|membership|" & Lower(_Record.Email),
             Department,
             "",
             JobTitle,
             "",
             Picture,
             ""
          ),
          Value,
          DisplayName
       ),
       _Record
    )
    You then set the DisplayFields of the Combo Box to
    "DisplayName"
    Then the DefaultSelectedItems should also work assuming that varDynamicPerson is also a full Person field. I am not sure you will actually need the Table() reference as a Person field is already a Table.
     
    Please Does this answer your question if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider answering Yes to Was this reply helpful? or give it a Like
    Visit my blog
    Practical Power Apps    LinkedIn  
  • CU06052007-0 Profile Picture
    12 on at
    Hello,
     
    Thank you all for your responses. The last one was especially most helpful and worked really well. Now the New and Edit forms are working as expected. I just have to figure out why the display form is still not showing the selected value.
     
    Thank you all once again. All your inputs have saved me a lot of time and frustration.
     
    regards,
    Sherazad.
  • CU06052007-0 Profile Picture
    12 on at
    And now I have full functioanlity by adding the following formual in SharePointIntegration onView:
     
    Set(varFormRecord, LookUp('<list name>', ID = SharePointIntegration.SelectedListItemID));
     
    Instead of the below I had before:
    Set(varFormRecord, SharePointIntegration.Selected)
     
    thanks,
    Sherazad.

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 Launch!

Jump in, show your community spirit, and win prizes!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Congratulations to the May Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
Valantis Profile Picture

Valantis 424

#2
WarrenBelz Profile Picture

WarrenBelz 355 Most Valuable Professional

#3
11manish Profile Picture

11manish 290

Last 30 days Overall leaderboard