cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
ques0buffet
Level: Powered On

Wait for required field to be populated in SharePoint

I'm working with a SharePoint library that has one required field titled Destination. 

A user will upload a document to a library, then populate the required field.

 

My current Flow logic:

Trigger:  When a file is created in a folder (sharepoint)

Get file metadata (sharepoint)

Get file properties(sharepoint)

 

The problem is, the Flow will start running before the user has a chance to populate the required field.

I tried getting around this by using a Do until action that loops on the Desition field, but I'm receiving the error below.

 

 

 

InvalidTemplate. Unable to process template language expressions for action 'Do_until' at line '1' and column '2173': 
'The template language expression 'not(equals(body('Get_file_properties')['Destination'], null))' 
cannot be evaluated because property 'Destination' doesn't exist, 
available properties are '@odata.etag, ItemInternalId, ID, Modified, Editor, Editor#Claims, 
OData__dlc_DocId, OData__dlc_DocIdUrl, Created, Author, Author#Claims, CheckoutUser, CheckoutUser#Claims, 
OData__DisplayName, {Identifier}, {IsFolder}, {Thumbnail}, {Link}, {Name}, {FilenameWithExtension}, 
{Path}, {FullPath}, {IsCheckedOut}, {VersionNumber}'. Please see https://aka.ms/logicexpressions for usage details.'.

 

 

Do until action logic:

Destination    is not equal to    null

Get file properties

 

 

1 ACCEPTED SOLUTION

Accepted Solutions
ques0buffet
Level: Powered On

Re: Wait for required field to be populated in SharePoint

I appreciate the reply but that's not really a viable solution.  If the user uploaded a file, then walked away from their desk, the Flow would fail. 

 

I ended up initiating a Do until action that looks for a value then continues.

 

Flow flow:

When files is changed

Get metadata

Get properties

Create variable

Condition --> Do until

Final step

 

More context of what I did:  https://www.sharepointed.com/2020/02/flow-power-automate-and-sharepoint-required-fields/

 

View solution in original post

3 REPLIES 3
DeepakS
Level 10

Re: Wait for required field to be populated in SharePoint

Hi @ques0buffet 

 

Your error indicates that "Destination" not available, and its because it does not have any value, so trigger -when file created(Get Properties) result schema does not include it.
I would suggest to add a Delay action just after the trigger and wait for 1 min or more, and this will allow users to update the file metadata. After this, I will call Get Properties.

2020-02-25_23-48-59.png

 

-------------------------------------------------------------------------
If I have answered your question, please mark your post as Solved.
If you like my response, please give it a Thumbs Up.

ques0buffet
Level: Powered On

Re: Wait for required field to be populated in SharePoint

I appreciate the reply but that's not really a viable solution.  If the user uploaded a file, then walked away from their desk, the Flow would fail. 

 

I ended up initiating a Do until action that looks for a value then continues.

 

Flow flow:

When files is changed

Get metadata

Get properties

Create variable

Condition --> Do until

Final step

 

More context of what I did:  https://www.sharepointed.com/2020/02/flow-power-automate-and-sharepoint-required-fields/

 

View solution in original post

DeepakS
Level 10

Re: Wait for required field to be populated in SharePoint

Hi @ques0buffet 

 

That makes sense. I forgot to ask you that do you have a time limit when the user will update the properties. If no, then you need to keep checking.
Have you also thought about a Power Automate that triggers when a file created or modified? So when a file created and if you don't get the details, you can end that run. When the user updates the details, the PA will re-trigger.
As i don't know details about your requirements so maybe triggering on update, something you don't want to do , but just sharing my thoughts.

 

Rgards,

 

Helpful resources

Announcements
firstImage

Better Together Contest Finalists Announced!

Congrats to the finalists of our ‘Better Together’-themed T-shirt design contest! Click for the top entries.

firstImage

Incoming: New and improved badges!

Look out for new contribution recognition badges coming SOON!

firstImage

New & Improved Power Automate Community Cookbook

We've updated and improved the layout and uploading format of the Power Automate Cookbook!

thirdimage

Power Automate Community User Group Member Badge

Fill out a quick form to claim your user group badge now!

sixthImage

Community Summit North America

The top training and networking event across the globe for Microsoft Business Applications

Top Solution Authors
Top Kudoed Authors
Users online (4,975)