I want to capture a photo on a PowerApps Screen I followed below steps and it works perfectly.
However, in the Canvas App Editor it gives me an error
Operation: On a Camara Click it will store the photo in the Dynamics Entity as primary image (Field Name entityimage, Display Name: PrimaryImage).
Code is as Below:
UpdateContext({lvarPic:cam_getWAB.Photo});
Patch(MyEnitty,Defaults(MyEntity),
{
Name:recordName,
PrimaryImage:lvarPic
});
Navigate(NextScreen);
After Pubishing it works absolutely as expteced but it still in the App Editor shows error and I cannot test it further in my Desktop.
Error is as below:
Any Help/Comment will be appriciated.
Hi @ArpG
I think the image data type is not match, ive tried this formula before and it works:
Collect(Camcoll, {Media:Camera1.Photo});
And then patch it to the Data Entity like this:
ForAll(Camcoll, Patch('EntityMedia', Defaults('EntityMedia'),{ImageData: Media});
Of course, you can patch it directly to the Entity without the collection.
See if this help.
Regards,
pytbyt
Hi @PytByt ,
Thanks for the reply.
In you solution you are putting the captured photo in a collection and then patching the image.
But while patching still you are passing the value of the item "Media", which is as good as storing the photo in a variable passing it in the Patch.
However, I have replicated the same way you did, but still have the same result.
New Code is as below,
Collect(Camcoll,{Media: cam_getWAB.Photo});
ForAll(Camcoll,Patch(MyEnitty,Defaults(MyEntity),{Name:recordName,PrimaryImage:Media}));
But result is exactly as before.
Regards,
Arpan
Hi @ArpG
You can always directly patch the cam_getWAB.Photo into your data entity.
Such as:
Patch(MyEntity,
Defaults(MyEntity),
{
Name:recordName,
PrimaryImage:cam_getWAB.Photo
}
);
See if this helps.
Regards,
pytbyt
Hi @PytByt ,
I tried that way as well, but error always same.
I don't know why this field(PrimaryImage) expecting a Record and not a Image.
I would like to mention that I am see this error after 15th Jan,2020. Before That I have never experienced it.
Regards,
Arpan
Hi @PK_Hong ,
Exactly on 15th Jan, I have tested the App without any error on the browser.
I am experiencein the problem after that. and surprizingly, eventhough the browser shows the error but after publishing the app works perfectly all right.
Now Question is who is going to investigate it ?
KR,
Arpan
Surprisingly it works after publishing?
I will test and hope it works.
BTW, microsoft staff has replied that using NewForm -> EditForm can SubmitForm to save image successfully and then i use Gallery to display. Just Remove is an issue.
At lease EditForm can do it and I have also prompted for investigation.
Please have a look in this link for a temporary counter action.
At least I don;t disappoint customer who is awaiting my Check-In-Check-Out apps for capturing GPS (excellent to show in map) and Picture (during check in...) though after enlarged, quality is still... .:(.
have a nice day
This training provides practical hands-on experience in creating Power Apps solutions in a full-day of instructor-led App creation workshop.
Come together to explore latest innovations in code and application development—and gain insights from experts from around the world.
User | Count |
---|---|
193 | |
70 | |
49 | |
48 | |
20 |
User | Count |
---|---|
250 | |
127 | |
84 | |
76 | |
74 |