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

Collection is showing empty row

Hi all. I have an PowerApp where the user can upload photos from their phone, and send them into SharePoint, with some metadata. The strange thing is, taht the collection always shows an empty row, and I don´t know what is wrong.

 

Step 1. the user sets some metadata taht should be attached to the photo

.Set metadataSet metadata

Step 2. The user collects the photos that should have the same metadata

PowerApp02.PNG

If you notice there is a blank field in the top (don´t know where it comes from).

 

Step 3. If I switch to the collection I can see that the empty row is part of the collection

PowerApp03.PNG

 

Has anyone tried that before? I have absolutely no idea how to fix this, and I cannot understand how i have gotten to create this extra row in the collection. Hop that someone can help me with this.

 

Greetings from Denmark

 

Frank Nielsen

 

1 ACCEPTED SOLUTION

Accepted Solutions
Highlighted

Hi timl. This is the code I have added to the button that collects photo and metadata.

 

Collect(Photos; { Photo:UploadedImage2.Image;  Filename: Concatenate("File"; Text(Now()); "-"; Text(CountRows(Photos)+1); ".jpg"); BIO: TextInput3.Text; Track: TextInput6.Text; Activ: TextInput4.Text; Loc: TextInput7.Text; Aar: TextInput1.Text})

 

The fun thing is, taht the problem seems to be a bit temporary. Sometoimes when I test, all pictures get the metadata, and I´m a happy guy. But sometimes the metadata is not attached to the picture. It is deliberately, that the TextInput fileds is not renamed, just in case if you're wondering.

 

/Frank

View solution in original post

5 REPLIES 5
Highlighted
Super User III
Super User III

Hi Frank,

I don't quite have an answer for you but I'm tagging @ericonline who I think has a similar issue with blank rows.

Eric - I thought this might be interesting. The thing it has in common is that it's a phone app, and it uses a collection and SharePoint.

@venseben - are you using the Patch function to save the record? If so, would you be able to share the code?

Highlighted

Hi @timl and @venseben,

My app appears to be writing empty rows to Sharepoint list only when "coming back online" via the mobile app and writing Saved records using the Collect() function. Hope that makes sense.

Symptoms:

  • Browser; Laptop; Connected:
    • Patch executes correctly. No blank row in the Sharepoint list.
  • App; Phone; Connected:
    • Patch executes correctly. No blank row in the Sharepoint list.
  • App; Phone; Disconnected:
    • Patch executes incorrectly. Blank row in the Sharepoint list.

Code:

  • OnStart:
    • LoadData(colPrePatch,"colLocalSave");
      Set(varConnected, Connection.Connected);
  • OnTimerEnd:
    • Set(varConnected, Connection.Connected)
      If(varConnected And "everything good",  <--shorthand
          Collect(mySharepointList,  <--using Collect to write data to sp list
              Defaults(mySharepointList),
              colPrePatch);
      Clear(colPrePatch);
      SaveData(colPrePatch,"colLocalSave")
  • Submit Button, OnSelect:
    • If varConnected:
      • Collect(colPrePatch,{my_form fields}) <--shorthand
        SubmitForm(my_form);
        Clear(colPrePatch);
        SaveData(colPrePatch,"colLocalSave");
    • If !varConnected:
      • Collect(colPrePatch,{my_form fields}) <--shorthand
        SaveData(colPrePatch,"colLocalSave");
      • Loop back to OnStart; Timer takes over
Highlighted

Hi @timl and @ericonline. THX for quick replys, awesome service form you.

 

I ended up deleting the collection, and building up a new collection from scratch. Now i works like a charm (almost), because i managed to remove the empty row.

PowerApp04.PNG

But when i take a look at the gallery, the first row is still missing all the lovely metadata, I have attached to the photo. Could it be because the first photo is number "0"? the filename is a concatenate between the now function and count of rows, and if the row number is "0", then maybe the metadata is uanable to be stored?

PowerApp05.PNG

/Frank

Highlighted

Hi Frank,

I'm glad that you're making a bit of progress on this. Could you show us the code that you're using? This might help us to better understand what the cause of the problem is. Are you simply Patching your new colleciton to SharePoint? 

@ericonline - thanks for clarifying your issue. I still hope you find an answer soon.

Highlighted

Hi timl. This is the code I have added to the button that collects photo and metadata.

 

Collect(Photos; { Photo:UploadedImage2.Image;  Filename: Concatenate("File"; Text(Now()); "-"; Text(CountRows(Photos)+1); ".jpg"); BIO: TextInput3.Text; Track: TextInput6.Text; Activ: TextInput4.Text; Loc: TextInput7.Text; Aar: TextInput1.Text})

 

The fun thing is, taht the problem seems to be a bit temporary. Sometoimes when I test, all pictures get the metadata, and I´m a happy guy. But sometimes the metadata is not attached to the picture. It is deliberately, that the TextInput fileds is not renamed, just in case if you're wondering.

 

/Frank

View solution in original post

Helpful resources

Announcements
Community Conference

Power Platform Community Conference

Check out the on demand sessions that are available now!

News & Announcements

Community Blog

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

secondImage

Power Platform 2020 release wave 2 plan

Features releasing from October 2020 through March 2021

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