web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Automate / Flow with conditions b...
Power Automate
Unanswered

Flow with conditions based on content type or custom properties

(2) ShareShare
ReportReport
Posted on by 14

Hello,

 

I am trying to create a Flow that moves a document when a new file is created in a document library where column X has a certain value.

 

When using a custom column (from a custom content type), I get this error:


InvalidTemplate
. Unable to process template language expressions for action 'Condition' at line '1' and column '2024': 'The template language expression 'contains(triggerOutputs()['headers']['TipoWorkFlow'], 'Fax')' cannot be evaluated because property 'TipoWorkFlow' doesn't exist, available properties are 'Pragma, Retry-After, x-ms-file-id, x-ms-file-name, x-ms-file-path, x-ms-file-etag, x-ms-request-id, Cache-Control, Date, Location, Set-Cookie, Server, X-AspNet-Version, X-Powered-By, Content-Length, Content-Disposition, Content-Type, Expires, Last-Modified'. Please see https://aka.ms/logicexpressions for usage details.'.

 

Even knowing the custom column I am using is valid (named "TipoWorkflow"), the flow is unable to validate it.

 

I am getting this error:


InvalidTemplate
. Unable to process template language expressions for action 'Condition' at line '1' and column '2024': 'The template language expression 'contains(triggerOutputs()['headers']['TipoWorkFlow'], 'Fax')' cannot be evaluated because property 'TipoWorkFlow' doesn't exist, available properties are 'Pragma, Retry-After, x-ms-file-id, x-ms-file-name, x-ms-file-path, x-ms-file-etag, x-ms-request-id, Cache-Control, Date, Location, Set-Cookie, Server, X-AspNet-Version, X-Powered-By, Content-Length, Content-Disposition, Content-Type, Expires, Last-Modified'. Please see https://aka.ms/logicexpressions for usage details.'.

 

Flow condition is like this:

 

Flow_CTProp_CustomCT.png

 

After that, I tried using Content Type property of the document both using content type name and content type id and althought I dont get an error anymore, the conditions is not verified,

 

Using content type id:

 

Flow_CTProp_CTID.png

 

Using content type name:

 

Flow_CTProp_CTName.png

 

The only way I got a condition to work was using the File name property.

 

Can anyone help?

 

Thanks,

Miguel

 

 

 

 

Categories:
I have the same question (0)
  • v-yamao-msft Profile Picture
    on at

    Hi Misidoro,

     

    Please try to use “File name” contains .fax in the condition to see if it works.

     

    Please check this thread for a reference:
    https://powerusers.microsoft.com/t5/Flow-Forum/eMail-Attachments-to-SP-Library-CodeTwo-signature-images/m-p/22070#M5198

     

    And about the “Column X”, could you provide more information about this column? Is it a column of the file content or anything else?

     

    Best regards,
    Mabel Mao

  • CRM Unified Interface Change on October 16th Profile Picture
    14 on at
    Hello Mabel,

    Thanks for the response.

    Using filename contais .fax wont work because file names may not contain fax in the name.

    Column X is from a custom content type associated with the document library.

    It is a choice column.

    The thing is that flow interface only shows default properties like File name, file content type, etc and doesnt seem to recognize custom content types and doesnt allow its fields to be used in conditions.

    Thanks,
    Miguel

  • CRM Unified Interface Change on October 16th Profile Picture
    14 on at

    Hello Mabel,

    Thanks for the response.

    Using filename contais .fax wont work because file names may not contain fax in the name.

    Column X is from a custom content type associated with the document library.

    It is a choice column.

    The thing is that flow interface only shows default properties like File name, file content type, etc and doesnt seem to recognize custom content types and doesnt allow its fields to be used in conditions.

     

    Any other ideas on how we can create conditions based on custom metadata?


    Thanks,
    Miguel

  • v-yamao-msft Profile Picture
    on at

    Hi Misidoro,

     

    You could get the type of the file by right clicking on the file>Properties>Type of file. Then configure the Condition as FileName contains .(file type).
    This condition works on .pdf and .xlsx, I guess it will also work on Fax file.
    Please have a try on it.

     

    About custom content of document library, it is currently not supported in flow, I have seen an idea at Flow Ideas Forum, please vote this idea at here:
    https://powerusers.microsoft.com/t5/Flow-Ideas/Flow-custom-SharePoint-library-columns/idi-p/3344
    I will also collect and report this from my side.

     

    Best regards,
    Mabel Mao

     

  • CRM Unified Interface Change on October 16th Profile Picture
    14 on at

    Thansk for the reply and the user idea suggestions, I will take a look.

    The solution based on file type although can be used in some scenarios, can't really be used in enterprise scenarios where what makes sense is to use custom content types to classify information.

     

    Thanks,

    Miguel

  • Ian Bruckner Profile Picture
    4 on at

    seems like content type values (ID/Name) aren't returning... even though such attributes are showing up as selectable.

  • Community Power Platform Member Profile Picture
    on at

    Currently trying to use A custom document set to determine if whether or not a flow should be initiated. Users should not be able to start a flow with a singular document, only when they submit a complete document set.  Does anyone know when Document sets (33761) are going to be modernized?? because it was scheduled for Q1 and we are now in Q2.....  After testing this thoroughly I was able to conclude that we cannot use Content Type as a condition it behaves irregularly.

     

    I've tried the following:

    • Custom Content Document Set Types : Invoice Approval
    • Equals: Invoice Approval, Picture, Document, Document Set for parameters Content Type, Content Type Name, Content ID
    • Used a conditional , and tried a switch statement.
    • Used the GUID ID for the content types with and without the 01xGUID prefix
    • Tried inverse logic "if not equal to" document with only other option as "Invoice Approval"
    • Uploading a document will not work either no option to select a content type.
    • Conclusion: Flow does NOT like Content Type as a control condition AT ALL.

    Resulting in mostly parameters did not meet criteria email being sent. Which means it's most definitely not seeing any of the content type.

     

     

     

  • JimmyW Profile Picture
    2,563 on at

    We cannot use the Column Content Type, this is not a column we can lookup, it is generated by SharePoint (CAML)

    You can make a workaround.

     

    Create a choice column that contains the name of each content type, user will have to select this. Then we can lookup that column because it contains data flow can get.

     

    Maybe we can use calculated columns, but even calculated columns cannot read from Content Type column.

    Im struggeling with this myself, maybe we can use the following (Not Tested yet, will test tomorow)

     

    SPREST-Versions (Get the data)

    Select and map the column (Content Type)

    Create HTML table (If we can see the output here we can use it in a condition.

     

    I will type my results tomorow

  • JimmyW Profile Picture
    2,563 on at

    We can extract and run a trigger on specific content type name or id using send http request.

    I will update later today again. 

     

    I will just try a simple condition like Content type = Document

     

    2019-04-18 08_09_03-Run History _ Microsoft Flow.png

  • JimmyW Profile Picture
    2,563 on at

    Seems like a condition works like Content type = Name of content type

     

    2019-04-18 08_26_58-Create your flow _ Microsoft Flow.png

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Automate

#1
Michael E. Gernaey Profile Picture

Michael E. Gernaey 538 Super User 2025 Season 2

#2
Tomac Profile Picture

Tomac 405 Moderator

#3
abm abm Profile Picture

abm abm 252 Most Valuable Professional

Last 30 days Overall leaderboard