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

Collect Image from Form

I have done made offline bar code. Implementation process followed as given in below link

https://powerapps.microsoft.com/en-us/blog/implementing-offline-capability-in-your-app/

Although everything is working except my form is collecting photos from form while offline.

Code for submit button - on Select

 

If(Connection.Connected,SubmitForm(Form2); Refresh(Table1); ClearCollect(BarcodeCollection,Table1);
SaveData(BarcodeCollection,"DataInLocalStorage")
,
Collect(DataToBeAdded,{Barcode:DataCardValue8.Text, Brand:Dropdown3.Selected.Value, Date:DataCardValue11.Text,Press:Dropdown2.Selected.Value, Tear_off:DataCardValue14.Text, Reel_End:DataCardValue13.Text, RS:Dropdown3.Selected.Value,image:Image4.Image} ); SaveData(DataToBeAdded, "newDataInLocalStorage"));

Navigate(Browse_Screen,ScreenTransition.Cover)

 

When offline image is not getting collected only blank comes up.

3 REPLIES 3
Super User III
Super User III

Hi @anupamdatt 

Firstly your offline code

Collect(
   DataToBeAdded,
   {
      Barcode:DataCardValue8.Text, 
      Brand:Dropdown3.Selected.Value, 
      Date:DataCardValue11.Text,
      Press:Dropdown2.Selected.Value, 
      Tear_off:DataCardValue14.Text, 
      Reel_End:DataCardValue13.Text, 
      RS:Dropdown3.Selected.Value,
      image:Image4.Image
   }
);
SaveData(
   DataToBeAdded, 
   "newDataInLocalStorage"
   )
)
Navigate(
   Browse_Screen,
   ScreenTransition.Cover
)

stores Image4.Image in Collection DataToBeAdded. Without seeing where you are getting this from , it is valid syntax for storing an image from an Image Control, so the first thing to check is what is arriving in the collection so change your logic to !Connection.Connected and remove the SaveData and then look in View > Collections to see if there is anything in the image field (that also is not a good name for a field - it is a Reserved Word in Power Apps).

If the image is there, you need to look at your LoadData code to see what is wrong there.

 

Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs Up.

@WarrenBelz 

 

I tried your recommendation could see my image in collection.

 

I checked excel file on to which I am storing data

 

image file earlier was appearing as link 

but now image file is being mention as

Previous

.\Barcode_images\91fe201dc4c44bf8946eecc1af869310.jpg

 

Now its coming as

appres://blobmanager/7148b4049fd849bfbc78add32e051872/1

 

 

Seems link not coming properly. Can provide some help

Hi @anupamdatt ,

Now you have mentioned the word you had not before - Excel. Please have a read of this article.

Excel was never designed (in my view anyway) for much more than reference lists and has too many limitations - I have not used it for some time and suggest you move to a SharePoint data source and almost all of your issues will go away.

Sorry, but I do not know the reason for the change, however SharePoint references the second one as a Thumbnail.

 

Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs Up.

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 (20,355)