Skip to main content

Notifications

Community site session details

Community site session details

Session Id :
Power Automate - Building Flows
Answered

Can't set string using Set Var

(0) ShareShare
ReportReport
Posted on by 33

This may be something simple, but I can't update a string var using "Set Var".

 

First I initialized the var:

1.png

 

Then I try to set the var:

2.png

 

And I get a non-descriptive error:

error.png

 

I also tried wrapping my string in "double" or 'single' quotes. Did not help.

  • marmot777 Profile Picture
    33 on at
    Re: Can't set string using Set Var

    After looking closer, your solution works. I just had to change

    int(variables('Delta Due Date Text'))

    to 

    int(variables('Delta Due Date'))

     in order to reference the right variable.

  • marmot777 Profile Picture
    33 on at
    Re: Can't set string using Set Var

    This example shows it successfully switching on a value of 7, and then erroring.

     

    4.png

  • marmot777 Profile Picture
    33 on at
    Re: Can't set string using Set Var

    Thanks Manish for taking a look. When I entered the expression in the Switch function, I got the following error upon running.

    3.png

    I felt the switch was working before. I observed the flow running through Case 2 or Case 3 as expected (and then erroring).

  • Verified answer
    ManishSolanki Profile Picture
    15,085 Super User 2025 Season 1 on at
    Re: Can't set string using Set Var

    Hi @marmot777 

     

    Pls try replacing input of switch action with an expression mentioned below:

    ManishSolanki_0-1714584566738.png

    Below expression needs to be added in the expression box as highlighted in the above screenshot:

    int(variables('Delta Due Date Text'))

     

     

     

     

    If this helps & solves your problem, please remember to give a 👍 and accept my solution as it will help others in the future.

     

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

Paul Stork – Community Spotlight

We are honored to recognize Paul Stork as our July 2025 Community…

Congratulations to the June Top 10 Community Leaders!

These are the community rock stars!

Announcing the Engage with the Community forum!

This forum is your space to connect, share, and grow!

Leaderboard > Power Automate

#1
Michael E. Gernaey Profile Picture

Michael E. Gernaey 497 Super User 2025 Season 1

#2
David_MA Profile Picture

David_MA 436 Super User 2025 Season 1

#3
Riyaz_riz11 Profile Picture

Riyaz_riz11 244 Super User 2025 Season 1