cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
ques0buffet
Helper II
Helper II

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

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
Resident Rockstar
Resident Rockstar

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.

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/

 

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
Power Automate News & Announcements

Power Automate News & Announcements

Keep up to date with current events and community announcements in the Power Automate community.

Microsoft 365 Conference – December 6-8, 2022

Microsoft 365 Conference – December 6-8, 2022

Join us in Las Vegas to experience community, incredible learning opportunities, and connections that will help grow skills, know-how, and more.

Power Automate Community Blog

Power Automate Community Blog

Check out the latest Community Blog from the community!

Users online (3,331)