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

Problem updating file properties, all previous files metadata gets replaced by new one

Hi,
I have an app where user uploads picture using 'add picture' control, everything was working fine, but from yesterday when I tried to move the app to a different account the problem started.
From the app I get info like package name and GPS coordinates.
GPS coordinates gets filled automatically, the user inputs the package name in the app.
The problem is every time user submits new picture from the app, the old pictures package name and GPS coordinates get replaced by the new files package name and GPS coordinates.
I don't get any error message from the app or flow.
Can anyone help me with the problem, please!

 

Regards,

Abdul Hannan

2 ACCEPTED SOLUTIONS

Accepted Solutions
Highlighted
Community Support
Community Support

Re: Problem updating file properties, all previous files metadata gets replaced by new one

Hi @AbdulHannan ,

 

Could you please try this flow? It's similar to yours but different. There is no need to format the output of JSON as Table/Array. so the Apply for Each action is also useless.

Remove the Compose action, modify the Schema and Remove the Apply for Each action.

The schema code for your case:

{
    "type""object",
    "properties": {
        "DataStream": {
            "type""string"
        },
        "Title": {
            "type""string"
        }
    }
}

Steps:

Snipaste_2020-03-26_18-10-12.png

View solution in original post

Highlighted
Community Support
Community Support

Re: Problem updating file properties, all previous files metadata gets replaced by new one

Hi @AbdulHannan ,

 

Remove the Collect formula and ColImage Collection, Add a TextInput box named FileNameBox, Set Upload button OnSelect:

testflow.Run(JSON({Title: FileNameBox.Text, DataStream:UploadedImage1.Image}, JSONFormat.IncludeBinaryData), PackageName.Text, SchemeName.Text, GPSCoordinate.Text)

Then this is will meet the schema of JSON, you can pass the custom file name to flow.

Hope this helps.

Sik

View solution in original post

8 REPLIES 8
Highlighted
Community Support
Community Support

Re: Problem updating file properties, all previous files metadata gets replaced by new one

Hi @AbdulHannan 

Could you please share more about 'move the app to a different account'? What does this mean?

Could you please share the flow steps? Why is there an Apply to Each action?

More information is needed so that we can provide further assistance.

Sik

 

Highlighted
Helper I
Helper I

Re: Problem updating file properties, all previous files metadata gets replaced by new one

Hi @v-siky-msft 
Thank you for your response.

 

Could you please share more about 'move the app to a different account'? What does this mean?

>> I created the app using my personal account, from that account i can not share it with other user, so I exported the app and and flow, and imported in my company account, from there the problem started. Now from both account I face the same problem. I recreated the app from scratch, twice in my company account but the result is same metadata gets replaced when i upload picture continuously. But if I close the app after each upload and reopen, then upload a picture then the metadata does not replace in the old files.

IS IT A CACHE RELATED ISSUE ??

 

 Why is there an Apply to Each action?

>> I am using apply to each because parseJSON outputs an array of objects.

 

Could you please share the flow steps?

>> Here is the flow

flow steps.png

 

 

I need to upload image with their original size and quality.
I am new to PowerApps, don't know much about it or how it works, I followed a YouTube video tutorial to create this app.

 

Regards,

Abdul Hannan

Highlighted
Community Support
Community Support

Re: Problem updating file properties, all previous files metadata gets replaced by new one

Hi @AbdulHannan ,

 

Could you please try this flow? It's similar to yours but different. There is no need to format the output of JSON as Table/Array. so the Apply for Each action is also useless.

Remove the Compose action, modify the Schema and Remove the Apply for Each action.

The schema code for your case:

{
    "type""object",
    "properties": {
        "DataStream": {
            "type""string"
        },
        "Title": {
            "type""string"
        }
    }
}

Steps:

Snipaste_2020-03-26_18-10-12.png

View solution in original post

Highlighted
Helper I
Helper I

Re: Problem updating file properties, all previous files metadata gets replaced by new one

Hi @v-siky-msft 

I tried the flow you suggested, I got "ValidationFailed. The schema validation failed." error.

error detail

[
  {
    "message""Invalid type. Expected Object but got Array.",
    "lineNumber"0,
    "linePosition"0,
    "path""",
    "schemaId""#",
    "errorType""type",
    "childErrors": []
  }
]
 

I am using this formula for my buttons

1) AddMediaButton1>>OnSlect>> Collect(ColImage,{Title: AddMediaButton1.FileName, DataStream:UploadedImage1.Image});
Set(MyGPS, Location.Latitude & "," & Location.Longitude);
Navigate(UploadScreen,ScreenTransition.Cover);

2) Upload Button>>OnSlect>> testflow.Run(JSON(ColImage, JSONFormat.IncludeBinaryData), PackageName.Text, SchemeName.Text, GPSCoordinate.Text)

Do I need to change anything here?

Also I want the user to input the file name instead of getting the file name from the file. Since I am using

"Title: AddMediaButton1.FileName" I couldn't figure out how to include the option to add file name manually.

 
Regards,
Abdul Hannan
Highlighted
Community Support
Community Support

Re: Problem updating file properties, all previous files metadata gets replaced by new one

Hi @AbdulHannan ,

 

Remove the Collect formula and ColImage Collection, Add a TextInput box named FileNameBox, Set Upload button OnSelect:

testflow.Run(JSON({Title: FileNameBox.Text, DataStream:UploadedImage1.Image}, JSONFormat.IncludeBinaryData), PackageName.Text, SchemeName.Text, GPSCoordinate.Text)

Then this is will meet the schema of JSON, you can pass the custom file name to flow.

Hope this helps.

Sik

View solution in original post

Highlighted
Helper I
Helper I

Re: Problem updating file properties, all previous files metadata gets replaced by new one

Hi @v-siky-msft 

 

I have removed Collect formula and ColImage from AddMediaButton1 and used the upload button formula that you provided But I am getting "Name isn't valid. Identifier not recognised" in upload button.

 

1) AddMediaButton1>>OnSlect>> Set(MyGPS, Location.Latitude & "," & Location.Longitude);
Navigate(UploadScreen,ScreenTransition.Cover);

Capture1.PNG

 

2) Upload Button>>OnSlect>> testflow.Run(JSON({Title: FileNameBox.Text, DataStream:UploadedImage1.Image}, JSONFormat.IncludeBinaryData), PackageName.Text, SchemeName.Text, GPSCoordinate.Text)

 

Capture2.PNG

 

Sorry, I am asking a lot of naive question 😓

 

Regards,

Abdul Hannan

Highlighted
Community Support
Community Support

Re: Problem updating file properties, all previous files metadata gets replaced by new one

Hi @AbdulHannan 

 

I found the FileName text box control name is not consistent. Keep it the same.

Snipaste_2020-03-27_11-55-45.png

Sik

Highlighted
Helper I
Helper I

Re: Problem updating file properties, all previous files metadata gets replaced by new one

Hi @v-siky-msft 

Thank you for your help.

I forgot check the file name, even when I typed it I was typing FileNameBox.Text 😥

The problem is solved now.

 

Regards,

Abdul Hannan

Helpful resources

Announcements
secondImage

Demo-Extravaganza 2020

Check out these cool Power Apps & vote on your favorite!

secondImage

Robotic Process Automation

Let's talk about the solution provided by Microsoft for Robotic Process Automation (RPA)

secondImage

Community Highlights

Check out whats happening in Power Apps

secondImage

Community User Group Member Badges

FIll out a quick form to claim your community user group member badge today!

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