I have SP an library with several columns of metadata - notably including these required columns:
I want users to be able select a file for which they're one of the Owners then edit the metadata and submit.
The SP list has Versioning and Content Approval set up and is absolutely critical.
The first screen is a pre-filtered Gallery where users select a file for which they're an Owner. The next screen is a Form linked to the file they selected based on passing the ID from the Gallery to the Form. Thus the screen initially displays all the metadata currently associated with the file. The user can then change anything they want and click a button to submit.
The problem is when I use SubmitForm the metadata in my SP library isn't updated. For completeness, the code is just:
SubmitForm([@Form__Screen_Metadata_Update__Overall])
Testing using OnSuccess and OnFail from the form confirms the submission fails. Any ideas why this might be?
Is this because I have Versioning and Content Approval enabled?
I'm not sure what screenshots to post to help answer this question.
Solved! Go to Solution.
PowerAutomate is the only way to do a check out. It is supported in the connector, but that action is only available to a flow (as far as I know).
You can certainly call a flow when you go to edit the record that would check it out and in your OnSuccess of the form submit, call a flow to check it in.
From what I can tell Checkin and Checkout are not functions available through the SharePoint connector in Power Apps. They are available in Power Automate. That's where I've always used them. But in regular SharePoint if 'Require Checkout' is enabled then you have to check out the file to even do updates to the metadata.
Let me know if you have issues with updating the multiple person columns in Power Automate. I have been successful doing that. but I thin you should be able to just call Power Automate to check out the file, then do the update in Power Apps, then call power automate again to check the file in.
Versioning and Content Approval do not prevent updating metadata on a document library. Can you provide more info on the form you are using, how it is bound to the Library/Item, what fields are on the form. There should be some other reason that it is failing.
Something else is causing your form to fail. Approval and Versioning are all supported in PowerApps and forms.
Have you made any alterations to your form that might be at issue?
@Pstork1 & @RandyHayes - thanks for the quick responses!
I'm honestly surprised y'all don't think it's related to Versioning & Approval simply because when I want to update a file's metadata in Power Automate, I have to check the file out via the flow to do that. I was thinking PowerApps would necessitate checking out the file to update metadata as well.
I removed several fields from the default form that the users shouldn't ever see or use (where I'm capturing its status in an approval workflow, a few date columns, etc.). Just for testing purposes, I've made ALL fields optional on the SP side.
Most other changes to the form in PowerApps are ensuring the submit button cannot be clicked until the fields have data in them.
This is the way I've linked the data. Selected_Document_ID is the document ID for the file selected by the user in the gallery on the previous screen. I'm confident that's working since all the correct metadata is getting pulled into the fields.
I did have to unlock some of the Datacards in order to edit position and size information. To test if it was those fields I replicated the screen with the form and deleted every field in the form except the 1 I didn't unlock. I then re-ran the app going through that new screen but I still got a confirmed failure on the form submission.
I also verified that the test account running the app has edit access in SP to the file whose metadata I'm modifying.
What other information can I give to help diagnose this?
Versioning and Content Approval alone won't cause an issue. But let me check on something else. Is Checkout required enabled in the Library? That would cause this kind of issue.
You're referring to Check out control. That is different than versioning or approval.
Not sure how that will play for the PowerApp form.
@Pstork1 - yes checkout is required in the library.
@RandyHayes - my mistake. I equate check out control with approval.
If there's a way to check-out then submit and check-in within PowerApps that would be fine by me. If not, I can use PowerAutomate. I'm hoping to avoid that simply because I've had difficulty getting multi-person columns to be properly updated when you have to pass person-information from PowerApps to Power Automate to then update SP.
PowerAutomate is the only way to do a check out. It is supported in the connector, but that action is only available to a flow (as far as I know).
You can certainly call a flow when you go to edit the record that would check it out and in your OnSuccess of the form submit, call a flow to check it in.
@RandyHayes - doing some quick testing, I think you're right! I verified that when I used my current form on a file which the user had checked out the SubmitForm succeeded.
And your solution is MUCH easier than what I've done in the past. Thank you! I'll try implementing that and see how it goes.
From what I can tell Checkin and Checkout are not functions available through the SharePoint connector in Power Apps. They are available in Power Automate. That's where I've always used them. But in regular SharePoint if 'Require Checkout' is enabled then you have to check out the file to even do updates to the metadata.
Let me know if you have issues with updating the multiple person columns in Power Automate. I have been successful doing that. but I thin you should be able to just call Power Automate to check out the file, then do the update in Power Apps, then call power automate again to check the file in.
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 |
---|---|
197 | |
68 | |
46 | |
41 | |
27 |
User | Count |
---|---|
254 | |
121 | |
84 | |
80 | |
73 |