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 / Unable to fetch data c...
Power Apps
Suggested Answer

Unable to fetch data correctly in collection

(0) ShareShare
ReportReport
Posted on by
Hello Experts,
 
I am unable to fetch data (one filed data) when callinga collection. It only happens when I click on a button that adds a row to the table and the nwhen I save the table it just takes data for that one colmn as blank and gets every other column perfectly. Please help me understand what is going wrong here. Here is the code for the plus button on the App:
 
//Collect(colRateCardInfoNew,{Units:0,internal:0,isExternal:0,OpexInt:0,Capex:0,RunPA:0,Remarks:"",dwcit_rowrder:""});
If(
    CountRows(
        Filter(
            'WebITCM RateCards Infos',
            'CS ID'.'CS ID' = cockpitsublevel.'CS ID'
        )
    ) <> galddsRateCard.AllItemsCount,
    UpdateContext({varPleaseWait: true});
    ForAll(
        galddsRateCard.AllItems As X,
        If(
            IsBlank(X.'RI ID'),
            Patch(
                'WebITCM RateCards Infos',
                Defaults('WebITCM RateCards Infos'),
                {
                    'Need Resouce': If(
                        "true" in X.tglddsRCIDtls.Value,
                        'Need Resouce (WebITCM RateCards Infos)'.Yes,
                        'Need Resouce (WebITCM RateCards Infos)'.No
                    ),
                    Domain: cockpitsublevel.'IT Domain',
                    SubDomain: cockpitsublevel.'IT SubDomain',
                    Product: cockpitsublevel.'IT Product',
                    'Category Counting': X.cbddsRCIDtls1.Selected.Value,
                    CeItem: X.ddlddsRCIDtls5.Selected.CeItem,
                    'Default Resource': X. ddlddsRCIDtls1.Selected.Value,
                    'Target Currency': X.ddlddsRCIDtls3.Selected.dwcit_targetcurrency,
                    Capitalizable: If(
                        X. ddlddsRCIDtls2.Selected.Value = "Yes",
                        'Capitalizable (WebITCM RateCards Infos)'.Yes,
                        'Capitalizable (WebITCM RateCards Infos)'.No
                    ),
                    'Unit Price Build': Coalesce(
                        Value(
                            Left(
                                X.lblddsRCIDtls2.Text,
                                Find(
                                    "/",
                                    X.lblddsRCIDtls2.Text
                                ) - 1
                            )
                        ),
                        0
                    ),
                    'Unit Price Run': Coalesce(
                        Value(
                            Right(
                                X.lblddsRCIDtls2.Text,
                                Len(X.lblddsRCIDtls2.Text) - Find(
                                    "/",
                                    X.lblddsRCIDtls2.Text
                                )
                            )
                        ),
                        0
                    ),
                    UnitsD: Value(X.txtddsRCIDtls1.Text),
                    Internal: Value(X.lblddsRCIDtls3t.Text),
                    External: Value(X.lblddsRCIDtls4t.Text),
                    OpexInt: Value(X.ddlddsRCIDtls3.Selected.dwcit_ceopexint),
                    Capex: Value(X.ddlddsRCIDtls3.Selected.dwcit_cecapex),
                    RunPA: Value(X.ddlddsRCIDtls3.Selected.dwcit_cerunpa),
                    OpexInc: Value(X.ddlddsRCIDtls3.Selected.dwcit_ceopexinc),
                    'Cost p.a': Round(
                        Text(
                            (Value(X.lblddsRCIDtls5t.Text + X.lblddsRCIDtls6t.Text) / If(
                                Or(
                                    IsBlank(Value(DataCardValue15_1.Text)),
                                    Value(DataCardValue15_1.Text) = 0
                                ),
                                1,
                                Value(DataCardValue15_1.Text) / 12
                            )) + Value(X.lblddsRCIDtls7t.Text),
                            "#,###0.##0"
                        ),
                        2
                    ),
                    OpexIntDC: Value(X.lblddsDTOpex.Text),
                    CapexDC: Value(X.lblddsDTCapex.Text),
                    RunPADC: Value(X.lblDTRunPA.Text),
                    CostPaDC: Value(X.lblddsCostPa.Text),
                    RowOrder: Value(X.txtddsOrder.Text),
                    'Asset Category': X.lblddsRCIDtlsAC.Text,
                    Remarks: X.txtddsRCIDtls2.Text,
                    'Owning Business Unit': LookUp(
                        'Business Units',
                        Name = comddsHeader.Country
                    ),
                    'CS ID': LookUp(
                        'WebITCM Cockpit SubLevels',
                        'CS ID' = cockpitsublevel.'CS ID'
                    ),
                    'CSCockpit Version Code': LookUp(
                        'WebITCM Cockpits',
                        'Cockpit Version Code' = varCockpitItem.cockpitversioncode
                    ),
                    'RIProject ID': LookUp(
                        'WebITCM Projects',
                        Code = varCockpitItem.projectcode
                    ),
                    'User Depending': If(
                        "Yes" in X.lblddsRCIDtls5t_UserDepending.Text,
                        'User Depending (WebITCM RateCards Infos)'.Yes,
                        'User Depending (WebITCM RateCards Infos)'.No
                    )
                }
            ),
            Patch(
                'WebITCM RateCards Infos',
                LookUp(
                    'WebITCM RateCards Infos',
                    'RI ID' = X.'RI ID'
                ),
                {
                    'Need Resouce': If(
                        "true" in X.tglddsRCIDtls.Value,
                        'Need Resouce (WebITCM RateCards Infos)'.Yes,
                        'Need Resouce (WebITCM RateCards Infos)'.No
                    ),
                    Domain: cockpitsublevel.'IT Domain',
                    SubDomain: cockpitsublevel.'IT SubDomain',
                    Product: cockpitsublevel.'IT Product',
                    'Category Counting': X.cbddsRCIDtls1.Selected.Value,
                    CeItem: X.lblddsRCIDtls1.Text,
                    'Default Resource': X.ddlddsRCIDtls1.Selected.Value,
                    'Target Currency': X.ddlddsRCIDtls3.Selected.dwcit_targetcurrency,
                    Capitalizable: If(
                        X.ddlddsRCIDtls2.Selected.Value = "Yes",
                        'Capitalizable (WebITCM RateCards Infos)'.Yes,
                        'Capitalizable (WebITCM RateCards Infos)'.No
                    ),
                    'Unit Price Build': Coalesce(
                        Value(
                            Left(
                                X.lblddsRCIDtls2.Text,
                                Find(
                                    "/",
                                    X.lblddsRCIDtls2.Text
                                ) - 1
                            )
                        ),
                        0
                    ),
                    'Unit Price Run': Coalesce(
                        Value(
                            Right(
                                X.lblddsRCIDtls2.Text,
                                Len(X.lblddsRCIDtls2.Text) - Find(
                                    "/",
                                    X.lblddsRCIDtls2.Text
                                )
                            )
                        ),
                        0
                    ),
                    'Asset Category': X.lblddsRCIDtlsAC.Text,
                    UnitsD: Value(X.txtddsRCIDtls1.Text),
                    Internal: Value(X.lblddsRCIDtls3t.Text),
                    External: Value(X.lblddsRCIDtls4t.Text),
                    OpexInt: Value(X.ddlddsRCIDtls3.Selected.dwcit_ceopexint),
                    Capex: Value(X.ddlddsRCIDtls3.Selected.dwcit_cecapex),
                    RunPA: Value(X.ddlddsRCIDtls3.Selected.dwcit_cerunpa),
                    OpexInc: Value(X.ddlddsRCIDtls3.Selected.dwcit_ceopexinc),
                    'Cost p.a': Round(
                        Text(
                            (Value(X.lblddsRCIDtls5t.Text + lblddsRCIDtls6t.Text) / If(
                                Or(
                                    IsBlank(Value(DataCardValue15_1.Text)),
                                    Value(DataCardValue15_1.Text) = 0
                                ),
                                1,
                                Value(DataCardValue15_1.Text) / 12
                            )) + Value(X.lblddsRCIDtls7t.Text),
                            "#,###0.##0"
                        ),
                        2
                    ),
                    OpexIntDC: Value(X.lblddsDTOpex.Text),
                    CapexDC: Value(X.lblddsDTCapex.Text),
                    RunPADC: Value(X.lblDTRunPA.Text),
                    CostPaDC: Value(X.lblddsCostPa.Text),
                    RowOrder: Value(X.txtddsOrder.Text),
                    Remarks: X.txtddsRCIDtls2.Text,
                    'Owning Business Unit': LookUp(
                        'Business Units',
                        Name = comddsHeader.Country
                    ),
                    'CS ID': LookUp(
                        'WebITCM Cockpit SubLevels',
                        'CS ID' = cockpitsublevel.'CS ID'
                    ),
                    'CSCockpit Version Code': LookUp(
                        'WebITCM Cockpits',
                        'Cockpit Version Code' = varCockpitItem.cockpitversioncode
                    ),
                    'RIProject ID': LookUp(
                        'WebITCM Projects',
                        Code = varCockpitItem.projectcode
                    ),
                    Default: If(
                        "Yes" in X.Default,
                        'Default (WebITCM RateCards Infos)'.Yes,
                        'Default (WebITCM RateCards Infos)'.No
                    ),
                    'User Depending': If(
                        "Yes" in X.lblddsRCIDtls5t_UserDepending.Text,
                        'User Depending (WebITCM RateCards Infos)'.Yes,
                        'User Depending (WebITCM RateCards Infos)'.No
                    )
                }
            )
        )
    );
    UpdateContext({varPleaseWait: false});
    Refresh('WebITCM RateCards Infos');
    ClearCollect(
        colRateCardInfoNew,
        Filter(
            'WebITCM RateCards Infos',
            'CS ID'.'CS ID' = cockpitsublevel.'CS ID'
        )
    );
    Collect(
        colRateCardInfoNew,
        {RowNo: galddsRateCard.AllItemsCount + 1}
    ),
    Collect(
        colRateCardInfoNew,
        {RowNo: galddsRateCard.AllItemsCount + 1}
    )
)
 
 
 
Am trying to get "Asset Category" correctly in the table but every time it fetches just blank data. Please ask me more questions if the data is not sufficient
Categories:
I have the same question (0)
  • Suggested answer
    Michael E. Gernaey Profile Picture
    53,968 Moderator on at
    Hi,
     
    I am not sure what you mean when you say Table. A picture if worth a 1000 words.
     
    Are you saying when you populate your Collection, which you use for your Table, the column is blank?
     
    Have you validated that the Collection itself, whether it is blank or not. I'm not asking you if you think your code is populating it, I am asking if you actually looked at the Collection, while your code is running and validating if it is or not.
     
    Is Asset Category a string or a Choice?
    Is the back end Dataverse or SharePoint?
     
    To me, my guess is
     
    1. The Text Label or Input you get the data from is blank
    2. It a choice field and you cannot patch a choice field like that.
     
     
     

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

Congratulations to the June Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 335 Most Valuable Professional

#2
11manish Profile Picture

11manish 166

#3
sannavajjala87 Profile Picture

sannavajjala87 71 Super User 2026 Season 1

Last 30 days Overall leaderboard