cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Helper V
Helper V

Power apps is not recognizing my column headers

Power apps is not recognizing my column headers in my collection.
On Page1, I have this call:

 

Collect(
    colCovidTeamSavedItems,
    {
        StartTime: varStartTime, StreetAddress: {Value: DataCardValue48.Text}, 
        StreetAddress2:DataCardValue49.Text, City:DataCardValue50.Text, 
        State:DataCardValue2.Text, Zip:DataCardValue3.Text, DoorAnswer: {Value: 
        DataCardValue51.Selected.Value}
});

 

 

 This establishes, among other things, that StartTime is a column header in the collection, colCovidTeamSavedItems. On Page2, where I want to add some data to the same row started on Page2, I am trying to use this code:

 

 

Patch(
    colCovidTeamSavedItems, 
    Filter(
        colCovidTeamSavedItems, StartTime = varStartTime
    ), 
    {
        LanguageIssue: DataCardValue58.Selected.Value, LSSpanish:  LSSpanishCheckbox.Value, 
        LSCreole:  LSCreoleCheckbox.Value, LSMaam:  LSMaamCheckbox.Value, LSOtherMayan:  
        LSOtherMayanCheckbox.Value, LSEnglish: LSEnglishCheckbox.Value,LSOtherLanguage:  
        LSOtherLanguageCheckbox.Value
    }
);

 

 

And I tried it without a Filter(*), but with a simple StartTime = varStartTime:

BenDonahue_0-1606829119914.png

I should note that, when I view my collection, StartTime is listed as a column header:

BenDonahue_0-1606831447397.png

 

It looks to me like StartTime is not being recognized as a column header in my collection, colCovidTeamSavedItems.
Thank you for you help in this.

1 ACCEPTED SOLUTION

Accepted Solutions
Super User III
Super User III

Hi @BenDonahue 

The second argument that you pass to the patch function should refer to a single record.

The filter function returns multiple rows, so this is the cause of the problem.

The way to resolve this would be to use the lookup function, rather than filter. The syntax would look like this:

Patch(
    colCovidTeamSavedItems, 
    Lookup(
        colCovidTeamSavedItems, StartTime = varStartTime
    ), 
    {
        LanguageIssue: DataCardValue58.Selected.Value, LSSpanish:  LSSpanishCheckbox.Value, 
        LSCreole:  LSCreoleCheckbox.Value, LSMaam:  LSMaamCheckbox.Value, LSOtherMayan:  
        LSOtherMayanCheckbox.Value, LSEnglish: LSEnglishCheckbox.Value,LSOtherLanguage:  
        LSOtherLanguageCheckbox.Value
    }
)

View solution in original post

2 REPLIES 2
Super User III
Super User III

Hi @BenDonahue 

The second argument that you pass to the patch function should refer to a single record.

The filter function returns multiple rows, so this is the cause of the problem.

The way to resolve this would be to use the lookup function, rather than filter. The syntax would look like this:

Patch(
    colCovidTeamSavedItems, 
    Lookup(
        colCovidTeamSavedItems, StartTime = varStartTime
    ), 
    {
        LanguageIssue: DataCardValue58.Selected.Value, LSSpanish:  LSSpanishCheckbox.Value, 
        LSCreole:  LSCreoleCheckbox.Value, LSMaam:  LSMaamCheckbox.Value, LSOtherMayan:  
        LSOtherMayanCheckbox.Value, LSEnglish: LSEnglishCheckbox.Value,LSOtherLanguage:  
        LSOtherLanguageCheckbox.Value
    }
)

View solution in original post

Helper V
Helper V

While I had the wrong formula, as @timl  was nice enough to take time to educate me on, implementing timl's fix exposed a second issue: The headers in my collection had not established themselves as headers at this point in the program. So, on Page1 I changed this code:

 

Collect(
    colCovidTeamSavedItems,
        {
            StartTime: varStartTime, StreetAddress: {Value: DataCardValue48.Text}, StreetAddress2:DataCardValue49.Text, City:DataCardValue50.Text, State:DataCardValue2.Text, Zip:DataCardValue3.Text, DoorAnswer: {Value: DataCardValue51.Selected.Value}
        }
    );

 

 

...to this code:

 

Collect(
    colCovidTeamSavedItems,
        {
            StartTime: varStartTime, StreetAddress: {Value: DataCardValue48.Text}, StreetAddress2:DataCardValue49.Text, City:DataCardValue50.Text, State:DataCardValue2.Text, Zip:DataCardValue3.Text, DoorAnswer: {Value: DataCardValue51.Selected.Value}, LanguageIssue:"", WillingToSpeak:"", CovidKnowledge:"", CurrentlyPositive:"", CurrentCOVIDIsolateSafely:"", PreviousCOVIDTestPositive:"", PreviousCOVIDIsolateSafely:"", TwoWeekCOVIDExposure:"", NumExposed:"", QuarantineSafely:"", CurrentConcernsOther:"", IfSickCanIsolate:"", PreExistingCondition:"", HasPCP:"", NumPeoplePreExistingCondition:"", NumAdults:"", NumChildren:"", HelpGrowKnowledge:"", CovidKnowledgeAfterVisit:"", HelpGrowKnowledgeOfResources:"", WillUseResourcesDescribed:"", MinutesSpent:"", CCFoodSecurity: false, CCRent: false, CCHealth: false, CCMeds: false, CCTransportation: false, CCNoConcerns: false, LSSpanish: false, LSCreole: false, LSMaam: false, LSOtherMayan: false, LSOtherLanguage: false, LSEnglish: false, RaceAfricanAmerican: false, RaceWhite: false, RaceNativeAmerican: false, RaceAsian: false, RaceNativeHawaiian: false, RaceOtherPacificIslander: false, RaceDecline: false, EthnicityHispanic: false, EthnicityNotHiospanic: false, EthnicityDecline: false, MatsMasks: false, MatsGloves: false, MatsEdMats: false, MatsFarmPackage: false, MatsNone: false, HPIntroductions: false, HPCOVID19Symptoms: false, HPCOVID19Transmission: false, HPCOVID19InImmokalee: false, HPPrevention: false, HPTesting: false, HPInHouseTestsPositive: false, HPResources: false
        }
    );

 

Which introduces all of my headers in my collection at once at the very beginning.
I just realized that this is much like initializing a variable.

Helpful resources

Announcements
News & Announcements

Community Blog

Stay up tp date on the latest blogs and activities in the community News & Announcements.

Power Apps Community Call

Power Apps Community Call- January

Mark your calendars and join us for the next Power Apps Community Call on January 20th, 8a PST

PP Bootcamp Carousel

Global Power Platform Bootcamp

Dive into the Power Platform stack with hands-on sessions and labs, virtually delivered to you by experts and community leaders.

secondImage

Power Platform Community Conference On Demand

Watch Nick Doelman's session from the 2020 Power Platform Community Conference on demand!

Top Solution Authors
Top Kudoed Authors
Users online (8,034)