cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
ArT1
Resolver I
Resolver I

Patching attachment to Dataverse

There is an issue I am facing with one of my powerapps canvas application form which I'm struggling to resolve. For context, the application I am creating is a job record application that assigns candidate to a job vacancy that is advertised by a specific client. So I have a client record and a candidate record. If a candidate fits the profile of whatever role the client is looking for, then a job record is created assigning the candidate to that job role. The records are created using forms that are patched and stored in Dataverse. 

 

So when a job record is created additional file attachments are required depending on what more documents the client needs from the candidate which are uploaded and sent to the client. For this, I used FormName.Updates function and it works perfectly. However, when I use the same function in the candidates record form, to patch multiple attachments I come across this error. Without the Update function all the other information type in the forms patches successfully, its only when I put FormName.Updates that creates an error. I am at a total loss at understanding where the problem is

1 ACCEPTED SOLUTION

Accepted Solutions
ArT1
Resolver I
Resolver I

I managed to resolve my issue. For some reason it had to do with the table properties I had selected when creating my dataverse table. I couldn't figure out the issue coding wise, so I thought that maybe it had to do with the table settings. So, I compared the table properties and found that the only difference between the job records and the candidate records table is that in the candidate records table I had selected the "Creating a new activity" which when the table is created cannot be disabled. In turn, I had to recreate another candidate record table and voila the update function started working perfectly. I'm not entirely sure if that was the main issue to the error I explained above, but it was the only difference I could spot and things started working out once I created a new table with the same selected table properties as the Job records table. 

View solution in original post

5 REPLIES 5
Mira_Ghaly
Dual Super User II
Dual Super User II

@ArT1 

Can you try using LastSubmit instead of updates?

 

 

If this post helps you with your problem, please mark your as Accepted solution.If you like my response, please give it a Thumbs Up.

Blog: here

No error shows up when I patch the form but the attachment field is empty and doesn't show the files I've uploaded

Mira_Ghaly
Dual Super User II
Dual Super User II

@ArT1 

So the attachments are added to the candidates form?

I don't know how your application is structured so if you can share screens of how it looks may be I try to reproduce something similar.

 

If this post helps you with your problem, please mark your as Accepted solution.If you like my response, please give it a Thumbs Up.

Blog: here

Yes. So I enabled the attachment feature on the Candidate Record table which is the attachment I've added to the form. Like I mentioned before, the patching of the form worked fine before I added the formula to patch the attachment field. So there was nothing else I changed from my code but just to add FormName.Updates function which showed the error shown in my first post (which I changed to LastSubmit from your last response and still no difference)

 

That is the patch code I used to submit my form:

 

Patch(
'Candidate Records',
'Candidate Record Gallery'.Selected,
{ 'fieldname 1': DataCardValue1.Text,

.......}
},
'Candidate Record Edit Form'.LastSubmit
);
ViewForm('Candidate Record Edit Form')

ArT1
Resolver I
Resolver I

I managed to resolve my issue. For some reason it had to do with the table properties I had selected when creating my dataverse table. I couldn't figure out the issue coding wise, so I thought that maybe it had to do with the table settings. So, I compared the table properties and found that the only difference between the job records and the candidate records table is that in the candidate records table I had selected the "Creating a new activity" which when the table is created cannot be disabled. In turn, I had to recreate another candidate record table and voila the update function started working perfectly. I'm not entirely sure if that was the main issue to the error I explained above, but it was the only difference I could spot and things started working out once I created a new table with the same selected table properties as the Job records table. 

Helpful resources

Announcements
Power Platform Call June 2022 768x460.png

Power Platform Community Call

Join us for the next call on August 17, 2022 at 8am PDT.

Power Platform Conf 2022 768x460.jpg

Join us for Microsoft Power Platform Conference

The first Microsoft-sponsored Power Platform Conference is coming in September. 100+ speakers, 150+ sessions, and what's new and next for Power Platform.

Users online (3,475)