cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
ereyaz
Level: Powered On

Why Collection display [object Object] instead of values

Hi Team,

 

I am creatingn apps online and using azure sql server.

 

I have created two tabales :

 

account (accountid,accountname)

accountaccess(accountid,userid)

 

when i am using below forumula on datatable Item command after creation of CAccountAccess and CAccount colleciton:

ShowColumns(
AddColumns(CAccountAccess,"AccountName",LookUp(CAccount, AccountID = CAccountAccess[@AccountID])),
"AccountID", "AccountName", "UserID")

 

it return below output

AccountID      AccountName   UserID

1                        [object Object]     abc

2                        [object Object]      xyz

 

instead of below output which is not showing.

AccountID      AccountName   UserID

1                        account1    abc

2                        account2     xyz

 

Please help. also when i am creating collection it also show same in collection. Please suggest what wrong with this. Why Account name is not displaying correctly.

 

Thanks in Advance...

Reyaz

1 ACCEPTED SOLUTION

Accepted Solutions
Power Apps Staff CarlosFigueira
Power Apps Staff

Re: Why Collection display [object Object] instead of values

In the LookUp function, if you don't specify which column you want to return (in your case, 'AccountName'), then it will return the entire object (record) with both the account id and the account name. In this case, you need to specify the column that you want retrieved by the LookUp as the third parameter to it:

ShowColumns(
    AddColumns(
        CAccountAccess,
        "AccountName",
        LookUp(
            CAccount,
            AccountID = CAccountAccess[@AccountID],
            AccountName)),
    "AccountID", "AccountName", "UserID")

Hope this helps!

View solution in original post

2 REPLIES 2
Power Apps Staff CarlosFigueira
Power Apps Staff

Re: Why Collection display [object Object] instead of values

In the LookUp function, if you don't specify which column you want to return (in your case, 'AccountName'), then it will return the entire object (record) with both the account id and the account name. In this case, you need to specify the column that you want retrieved by the LookUp as the third parameter to it:

ShowColumns(
    AddColumns(
        CAccountAccess,
        "AccountName",
        LookUp(
            CAccount,
            AccountID = CAccountAccess[@AccountID],
            AccountName)),
    "AccountID", "AccountName", "UserID")

Hope this helps!

View solution in original post

ereyaz
Level: Powered On

Re: Why Collection display [object Object] instead of values

Thanks for the quick response and solution.

Helpful resources

Announcements
thirdimage

Power Apps Community User Group Member Badge

Fill out a quick form to claim your user group badge now!

sixthImage

Power Platform World Tour

Find out where you can attend!

Power Platform 2019 release wave 2 plan

Power Platform 2019 release wave 2 plan

Features releasing from October 2019 through March 2020

SecondImage

Difinity Conference

The largest Power BI, Power Platform, and Data conference in New Zealand

Top Kudoed Authors (Last 30 Days)
Users online (5,548)