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 / Desktop Errors Variabl...
Power Automate
Unanswered

Desktop Errors Variable setting

(1) ShareShare
ReportReport
Posted on by 4
My version of Desktop is suddenly producing errors when I amend or create new flows
my untouched flows (which were built before PowerFX) are working OK
Example without PowerFX
I created a very simple test rig to debug the process
I create a variable MyVariable with a string value
I try to read that variable into second variable
%MyVariable%
 
I get an error.
Message = Object reference not set to an instance of an object.
Error = System.NullReferenceException
Full text = System.NullReferenceException: Object reference not set to an instance of an object.
   at Microsoft.Flow.RPA.Desktop.Designer.Core.DesignerProgram.Statements.PowerFx.PowerFxVariableUsagesVisitor.ContainsVariableInExpression(PowerFxExpression expression)
   at Microsoft.Flow.RPA.Desktop.Designer.Core.DesignerProgram.Statements.PowerFx.PowerFxVariableUsagesVisitor.Visit(PowerFxExpression expression)
   at Microsoft.Flow.RPA.Desktop.Designer.Core.DesignerProgram.Statements.PowerFx.PowerFxVariableUsagesVisitor.Apply(IEvaluatableContext root)
   at Microsoft.Flow.RPA.Desktop.Designer.Core.DesignerProgram.Statements.PowerFx.VariableUsagesStatementVisitor.Apply(IStatement statement, IEvaluatableContext expression)
   at Microsoft.Flow.RPA.Desktop.Robin.Language.Contexts.Statements.Visitors.StatementVisitor.Visit(IAssignStatement statement)
   at Microsoft.Flow.RPA.Desktop.Common.Structures.Extensions.EnumerableExtensions.ForEach[T](IEnumerable`1 en, Action`1 action)
   at Microsoft.Flow.RPA.Desktop.Designer.Core.DesignerProgram.Statements.PowerFx.VariableUsagesStatementVisitor.FindUsages(IEnumerable`1 statements)
   at Microsoft.Flow.RPA.Desktop.Designer.Core.DesignerProgram.Statements.StatementListTraverser.<>c__DisplayClass15_0.<FindStatementsWithVariables>b__0(String variable)
   at Microsoft.Flow.RPA.Desktop.Common.Structures.Extensions.EnumerableExtensions.ForEach[T](IEnumerable`1 en, Action`1 action)
   at Microsoft.Flow.RPA.Desktop.Designer.Core.DesignerProgram.Statements.StatementListTraverser.FindStatementsWithVariables(ISet`1 variableNames, String subflowName)
   at Microsoft.Flow.RPA.Desktop.Designer.Core.DesignerProgram.ProgramFacade.GetVariableUsages(String subflowName, ISet`1 variableNames, IStatementListFacade statementListFacade, StatementsLookup statementsLookup)
   at Microsoft.Flow.RPA.Desktop.Designer.Core.DesignerProgram.ProgramFacade.GetUsedFlowVariables(String subflowName, IReadOnlyList`1 programItems)
   at Microsoft.Flow.RPA.Desktop.Designer.Core.DesignerProgram.FunctionFacade.GetUsedFlowVariables(IReadOnlyList`1 programItems)
   at Microsoft.Flow.RPA.Desktop.Designer.Core.DesignerProgram.FunctionFacade.GetUsedFlowSensitiveVariables(IReadOnlyList`1 programItems)
   at Microsoft.Flow.RPA.Desktop.Designer.Core.DesignerProgram.Functions.Actions.UpdateProgramItemAction.Do()
   at Microsoft.Flow.RPA.Desktop.Designer.Core.DesignerProgram.Functions.Actions.ActionsHistory.Do(IAction action)
   at Microsoft.Flow.RPA.Desktop.Designer.Application.DesignerProgram.ProgramItems.Commands.UpdateProgramItemCommandHandler.Handle(UpdateProgramItemCommand request, CancellationToken cancellationToken)
   at MediatR.Pipeline.RequestPostProcessorBehavior`2.<Handle>d__2.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at MediatR.Pipeline.RequestPreProcessorBehavior`2.<Handle>d__2.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at Microsoft.Flow.RPA.Desktop.Designer.UI.FunctionsArea.ViewModels.FunctionViewModel.<EditActionAsync>d__105.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
   at System.Windows.Threading.ExceptionWrapper.InternalRealCall(Delegate callback, Object args, Int32 numArgs)
   at System.Windows.Threading.ExceptionWrapper.TryCatchWhen(Object source, Delegate callback, Object args, Int32 numArgs, Delegate catchHandler)
 
With PowerFX I store Get Special Folder (Document) which works ok and stores a string with my documents path
I cannot find a way to concatenate a variable containing the path with a text string. (tried all manner of options).
For other variables $ at start and {variable name} works but not if the variable was created by Get Special Folder
 
Categories:
I have the same question (0)
  • Nived_Nambiar Profile Picture
    18,138 Super User 2026 Season 1 on at
    Hi,
     
    to be clear, you are having a folder path obtained by get special folder action. Now you are trying to concatenate special folder path and text variable in PowerFx enabled flow- but you aren't able to do it - correct ?
     
    Thanks & Regards,
    Nived N 
    LinkedIn: Nived N's LinkedIn
    YouTube: Nived N's YouTube Channel
    Blog: Nived Nambiar's Blogs
     Found my answer helpful? Please consider marking it as the solution!
     Your appreciation keeps me motivated. Thank you!

     
  • Zygmunt2 Profile Picture
    4 on at
    Yes.
     
    But when I tried to recreate the flow without PowerFX I go the error shown.
    I then created a tiny two line test rig without powerfx to try to isolate the problem and got the same error.
    Just starting a test using a different machine to see if the problem is machine specific
  • Nived_Nambiar Profile Picture
    18,138 Super User 2026 Season 1 on at
    Hi,
     
    for better clarity- share a screenshot of flow please - that would be helpful to investigate what's issue exactly is ?
     
    Thanks & Regards,
    Nived N 
    LinkedIn: Nived N's LinkedIn
    YouTube: Nived N's YouTube Channel
    Blog: Nived Nambiar's Blogs
     Found my answer helpful? Please consider marking it as the solution!
     Your appreciation keeps me motivated. Thank you!

     
     
     

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

Congratulations to the June Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Automate

#1
David_MA Profile Picture

David_MA 274 Super User 2026 Season 1

#2
11manish Profile Picture

11manish 175

#3
Haque Profile Picture

Haque 166

Last 30 days Overall leaderboard