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 / [object, Object] on su...
Power Apps
Answered

[object, Object] on submit form

(0) ShareShare
ReportReport
Posted on by 443

Hi there,

 

i am building a purchase request app and i came across this issue:

I want a person or group dropdown field (ManagerDD) to be auto-populated based on the value of another dropdown.

This works. Now when i complete the necessary fields and submit the form, the value of the dropdown turns to [object,Object].

OnStart of my app i collect data from the SharePoint Lists.

ClearCollect(
HotelManagerCol,
ShowColumns(AddColumns
(Hotels,"Claims",Manager.Claims,
"Email",Manager.Email,"DisplayName",Manager.DisplayName),
"Claims","Email","Title","ID","DisplayName")
);

in the Manager dropdown Items: Filter(ShowColumns(HotelManagerCol,"Title","DisplayName","Email","Claims"),Title = Hoteldropdown.Selected.Value).

 

on the OnChange property of the Hotel dropdown i set a variable as follows:

Set(AssignToUserVar,First(Filter(HotelManagerCol,Title = Hoteldropdown.Selected.Value)))

i use this variable in the default selected items property of the manager dropdown and the Update property of it's datacard

Is there something i am missing here ?

 

Categories:
I have the same question (0)
  • v-yutliu-msft Profile Picture
    Microsoft Employee on at

    Hi @marial16 ,

    Do you mean that you set Manager dropdown Items:

     Filter(ShowColumns(HotelManagerCol,"Title","DisplayName","Email","Claims"),Title = Hoteldropdown.Selected.Value)

    set Manager default selected items:

    AssignToUserVar?

    Please notice :
    1)Manager dropdown Items have these fields: "Title","DisplayName","Email","Claims"

    2)Manager default selected items have these fields: "Claims","Email","Title","ID","DisplayName"

    It means that you set these two properties to different tables.

    You need to set these two properties to the same structure of data.

     

     

    The person field structure should like like this:

    {'@odata.type':"#Microsoft.Azure.Connectors.SharePoint.SPListExpandedUser",
     Claims:"i:0#.f|membership|" & User().Email,
     Department:"",
     DisplayName:User().FullName,
     Email:User().Email,
     JobTitle:"",
     Picture:""
     }

    It seems that your collection does not meet the requirement.

    Please build a collection with these above fields to update your person field.

    Try this:

    1)OnStart

    ClearCollect(
    HotelManagerCol,
    ShowColumns(AddColumns
    (Hotels,"Claims",Manager.Claims,
    "Email",Manager.Email,"DisplayName",Manager.DisplayName),
    "Claims","Email","Title","DisplayName")
    );

    2)in the Manager dropdown Items: 

    DropColumns(
    AddColumns(
    Filter(ShowColumns(HotelManagerCol,"Title","DisplayName","Email","Claims"),Title = Hoteldropdown.Selected.Value),
    "'@odata.type'","#Microsoft.Azure.Connectors.SharePoint.SPListExpandedUser",
    "Department","",
    "JobTitle","",
    "Picture",""
    ),
    "Title"
    )
    

    3)on the OnChange property of the Hotel dropdown 

    Set(AssignToUserVar,
    First(
    DropColumns(
    AddColumns(
    Filter(ShowColumns(HotelManagerCol,"Title","DisplayName","Email","Claims"),Title = Hoteldropdown.Selected.Value),
    "'@odata.type'","#Microsoft.Azure.Connectors.SharePoint.SPListExpandedUser",
    "Department","",
    "JobTitle","",
    "Picture",""
    ),
    "Title"
    )
    )
    )

    4) use this variable in  the default selected items property of the manager dropdown and the Update property of it's datacard.

     

     

    If the problem still exists, please show me your data structure of Hotels list and Hoteldropdown's settings.

     

     

    Best regards,

  • marial16 Profile Picture
    443 on at

    It didn't work i am afraid.

    my Hotels List has 2 columns. Title and Manager(person/group)

    In the Hotel dropdown in the items property i use data from another collection.

    In the default selected Items of the Manager dropdown:

    If(
    NewForm.Mode = FormMode.New,
    If(!IsBlank(Hoteldropdown.Selected.Value),

    { DisplayName:AssignToUserVar.DisplayName,
    Claims:AssignToUserVar.Claims,
    Department:"",
    Email:AssignToUserVar.Email,
    JobTitle:"", Picture:""},
    {
    '@odata.type':"#Microsoft.Azure.Connectors.SharePoint.SPListExpandedReference",
    Value: ""
    }), {
    '@odata.type':"#Microsoft.Azure.Connectors.SharePoint.SPListExpandedReference",
    Value:Parent.Default
    }
    )

     

  • Verified answer
    v-yutliu-msft Profile Picture
    Microsoft Employee on at

    Hi @marial16 ,

    One person field's structure should be like this:

    {'@odata.type':"#Microsoft.Azure.Connectors.SharePoint.SPListExpandedUser",
     Claims:"i:0#.f|membership|michael@wiXXXX.onmicrosoft.com",
     Department:"",
     DisplayName:"Michael Shao",
     Email:"Michael@wiXXXX.onmicrosoft.com",
     JobTitle:"",
     Picture:""
     }

     

    So I suggest you try this formula:

    If(
    NewForm.Mode = FormMode.New&&
    !IsBlank(Hoteldropdown.Selected.Value),
    { DisplayName:AssignToUserVar.DisplayName,
    Claims:AssignToUserVar.Claims,
    Department:"",
    Email:AssignToUserVar.Email,
    JobTitle:"", 
    Picture:"",
    '@odata.type':"#Microsoft.Azure.Connectors.SharePoint.SPListExpandedReference"
    }
    )
    


     

     

    Best regards,

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 483

#2
WarrenBelz Profile Picture

WarrenBelz 399 Most Valuable Professional

#3
11manish Profile Picture

11manish 327

Last 30 days Overall leaderboard