cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Frequent Visitor

Problem Creating Collection with Form Name as a field - bug?

I'm trying to create a Collection that includes Form Names.

Seems like there is a bug (or maybe I'm doing something wrong) - the array won't accept more than one Form Name.

Case 1: Here's what I'm trying to do that does not work:

 

    ClearCollect (appendixMetaData, 
        {name:"Respiratory", screen:'Respiratory and Sleep', data: 'sr_append_2_RespiratoryandSleep', form: FormAppend2Respiratory},
        {name:"Addiction", screen:'Addiction - Screen', data: sr_append_1_AddictionMed, form: FormAppend1Addiction}
        );

 

Case 2: Including a "form:" value only on the 1st row works fine:  

 

    ClearCollect (appendixMetaData, 
        {name:"Respiratory", screen:'Respiratory and Sleep', data: 'sr_append_2_RespiratoryandSleep', form: FormAppend2Respiratory},
        {name:"Addiction", screen:'Addiction - Screen', data: sr_append_1_AddictionMed}
        );

 

Case 3: Including a "form:" value only on the 2nd row works fine: 

 

    ClearCollect (appendixMetaData, 
        {name:"Respiratory", screen:'Respiratory and Sleep', data: 'sr_append_2_RespiratoryandSleep'},
        {name:"Addiction", screen:'Addiction - Screen', data: sr_append_1_AddictionMed, form: FormAppend1Addiction}
        );

 

 

When I say "Works fine" = After I run App OnStart > View > Collections > appendixMetaData, I can see a value of "Control" in the table field for case 2 and 3.

Case 1 gives red squiggly lines App Onstart won't run.

This a bug or User error?

In case people can suggest workarounds - I have 37 different rows I need to add to this collection

Thanks!

4 REPLIES 4
Super User II
Super User II

Hi @BenMunk 

I believe you have left out the Table() function in your Clear Collect.  From the documention 

ClearCollect( IceCreamSales, 
 	Table(
    	{ Flavor: "Strawberry", UnitPrice: 1.99, QuantitySold: 20 }, 
    	{ Flavor: "Chocolate", UnitPrice: 2.99, QuantitySold: 45 },
    	{ Flavor: "Vanilla", UnitPrice: 1.50, QuantitySold: 35 }
 	)
 )

ref. https://docs.microsoft.com/en-us/powerapps/maker/canvas-apps/functions/function-table-shaping 

Thanks for you suggestion, but still doesn't seem to be working.  Its very strange.

It seems like the collection/table will only accept 1 form control. 

Gif below - see the infamous squiggly lines appear and disappear as I remove one or the other, or rename the field in one row.

511DCD2B-D5B3-4240-94A3-33D652EAF40A.GIF

@BenMunk 

It may be a syntax error.  It looks like  you are missing the double quotes around the actual data in your table.  Please see https://docs.microsoft.com/en-us/powerapps/maker/canvas-apps/functions/function-table  for the correct syntax.  Numbers don't need them but text does.

Thanks again, hopefully we can resolve through trial and error.

Tried above, it seems double quotes makes the table collection work (not error) but changing to:

form: "FormAppend1Addiction"

makes the form value a text string instead of an object.

Therefore, later when I try

Navigate([lookup collection function goes here].form,fade)

 It won't navigate since form is a text string not an object.

It's really strange - everything works perfectly until I add a 2nd row to the collection.  With a single row collection everything works fine.

Helpful resources

Announcements
New Badges

New Solution Badges!

Check out our new profile badges recognizing authored solutions!

New Power Super Users

Congratulations!

We are excited to announce the Power Apps Super Users!

Power Apps Community Call

Power Apps Community Call: February

Did you miss the call? Check out the Power Apps Community Call here.

Microsoft Ignite

Microsoft Ignite

Join digitally, March 2–4, 2021 to explore new tech that's ready to implement. Experience the keynote in mixed reality through AltspaceVR!

Top Solution Authors
Top Kudoed Authors
Users online (19,936)