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

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Automate / Initialize/Set Variabl...
Power Automate
Unanswered

Initialize/Set Variable doesn't support Secure Inputs/Outputs?

(0) ShareShare
ReportReport
Posted on by 54

Please vote for the idea to add support for this here.  ("variable" actions to support Secure Inputs and Secure Outputs)

The Initialize Variable and Set Variable actions don't appear to support Secure Inputs and Secure Outputs.  This seems like an oversight.  If I need to assign a secure value to a variable, this action will reveal the value in the run history.

 

Does anyone have a suggestion on how to get around this, to keep the value secured in the run history?

 

This is a very simplified example, but the graphic below shows the issue.  I have Secure Inputs set on the Compose action, which simply contains the static text "this is my data to hide".  You can see how it's still secured in the Set Variable input, but revealed in the Output.

 

Again, this is a very simplified example, but in my real situation, I need to use a variable because the value could be different for different situations inside a series of Condition blocks, and used later after the Condition blocks.

 

clh_0-1656522592856.png

 

Categories:
  • Jcook Profile Picture
    7,783 Most Valuable Professional on at

    Hello @clh 

     

    You could switch this around and start with the compose action. The compose can secure the inputs and outputs. Than you can store this compose value inside the variable. Which will be hidden from run view.

  • clh Profile Picture
    54 on at

    Sadly, it doesn't work that way.  Take another look at the screen shot in my original example.  That's exactly what I do.  It indeed hides the value on the Set Variable input, but reveals the value on the Set Variable output.  I can't find any way to cause it to be hidden on the Set Variable output.

  • v-yujincui-msft Profile Picture
    Microsoft Employee on at

    Hi @clh ,

     

    Maybe you could try to add an 'Append to string variable' Action to set the value of the variable, and then add a ‘Set variable’ Action to set the variable to null after the variable has been used.

    vyujincuimsft_2-1657000310346.png

    Result Screenshot:

    vyujincuimsft_0-1656999869472.png

    vyujincuimsft_1-1656999895965.png

     

     

    Best Regards,
    Charlie Choi

  • clh Profile Picture
    54 on at

    That might work for string variables if you only have a single instance of assigning to a variable that needs to be protected.  But I don't think it would work if the same variable can be reassigned a new value as it progresses through a series of Conditions.  I can't just keep appending the new value to the original value.  OH, maybe if it's reversed.  That is, do Set Variable back to null first, then use Append to String Variable for the new value as suggested.  Yes, that might work for strings.

     

    The other issue though is that in my case the variable is an object variable.  I have a series of Condition and Compose actions that use the AddProperty, SetProperty, or RemoveProperty functions to modify the overall object.  Then after each Condition/Compose I have to reassign the value to a variable to track the true current value of the object for the next Condition/Compose set, and for the overall final value.  I don't see any other action for object variables akin to Append to String that I could use in the same way.

  • clh Profile Picture
    54 on at

    First, I submitted an idea that "variable" actions should support Secure Inputs and Secure Outputs.  Please vote for it here .

     

    If anybody still has a better idea, I'd still love to see it.

     

    In the mean time I think I found a workaround, expanding on the idea provided above by @v-yujincui-msft, but should work for any variable type.  In short, use an array variable and the "Append to array" action.  An array item can be of any data type.  Use my follow-up idea above to set the array to null before reassigning the new value, and when needing to reference the actual variable value later, simply reference the 0 index item, variables('varArrayName')[0].

     

    Below is a very oversimplified example of it.  Normally of course you wouldn't have a string of static changes like this.  In my real flow, the successive Compose and Set/Append variable actions are contained within Condition blocks so the properties may or may not get changed along the way, which is the reason I need to track the current and final value in a variable.

     

    The expressions in the later Compose actions are as follows, respectively...

    addProperty(variables('testVarArray')[0], 'c', 'value c added by addProperty')

    addProperty(variables('testVarArray')[0], 'd', 'value d added by addProperty')

     

    The final "Initialize variable testVarArrayReveal" was simply to utilize the absence of the Secure option on the "Initialize variable" action to reveal in the run history that the final value of the array variable indeed contained the expected final value with "c" and "d" properties added.

     

    clh_0-1657044088698.png

     

    This produces the following run history.

    clh_2-1657044853995.png

    clh_3-1657044874555.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

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Leaderboard > Power Automate

#1
Mohsin Ali Profile Picture

Mohsin Ali 377

#2
11manish Profile Picture

11manish 292 Super User 2026 Season 2

#3
Henil Profile Picture

Henil 128

Last 30 days Overall leaderboard