Skip to main content

Notifications

Power Automate - Using Connectors
Answered

Using operators on dynamic content in text field

(0) ShareShare
ReportReport
Posted on by 94

Hello,

 

I would like to be able to modify a date stored in dynamic content and use that in my flows. My code below just treats my operators as a string, so the output is something like "3/15/2017 - 14" where instead I would like it to be "3/1/2017"

 

Date Testing.PNG


Thank you all

  • ChrisC Profile Picture
    ChrisC 94 on at
    Re: Using operators on dynamic content in text field

    Thank you for this!

  • Verified answer
    v-micsh-msft Profile Picture
    v-micsh-msft on at
    Re: Using operators on dynamic content in text field

    Hi @ChrisC,

     

    Yes, there is a way to return the results without quotes.

    After the trigger action, add a Compose Action, then copy and paste the following in the Compose Input box:

    "@Adddays(triggerBody()?['StartDate'],-14,'MM/dd/yyyy')"

    After that, use the Compose output as results.

    See screenshots:

    77.PNG

    Reply back if you need any further assistance.

    Regards

  • ChrisC Profile Picture
    ChrisC 94 on at
    Re: Using operators on dynamic content in text field

    That is fantastic @v-micsh-msft! It works wonderfully.

     

    I have to ask - the result returns in quotes. Is there any way around this? Ex: The input is 3/24/2017, but the output is "3/10/2017", quotes included. Is there any way to return the result without the surrounding quotes?

  • v-micsh-msft Profile Picture
    v-micsh-msft on at
    Re: Using operators on dynamic content in text field

    Hi @ChrisC,

     

    You need to take use of the Workflow Definition Language to deal with that.

    Could you please share about the previous steps, better with a screenshot of your flow?

    Using WDL would need to translate the Dynamic content into content that could be understood by the language.

    For example, if the previous step is "When a new event is created" (I suspect),

    Then we need to change the Body input of the Send an Email action with the formula below:

    "@{Adddays(triggerBody()?['StartDate'],-14,'MM/dd/yyyy')}"

    if the previous step is not a trigger, then I would need more information to make it work.

    Adding the workflow Definition language as the reference:

    Workflow Definition Language

    Regards

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

Microsoft Kickstarter Events…

Register for Microsoft Kickstarter Events…

Announcing Our 2025 Season 1 Super Users!

A new season of Super Users has arrived, and we are so grateful for the daily…

Announcing Forum Attachment Improvements!

We're excited to announce that attachments for replies in forums and improved…

Leaderboard

#1
WarrenBelz Profile Picture

WarrenBelz 145,636

#2
RandyHayes Profile Picture

RandyHayes 76,287

#3
Pstork1 Profile Picture

Pstork1 64,942

Leaderboard

Featured topics