Main.xaml: System.Collections.Generic.KeyNotFoundException: The given key 'fourth_previous_earnings_date' was not present in the dictionary


Main.xaml: System.Collections.Generic.KeyNotFoundException: The given key ‘fourth_previous_earnings_date’ was not present in the dictionary. at System.Collections.Generic.Dictionary2.get_Item(TKey key) at System.Activities.Validation.RoslynExpressionValidator.GetErrorActivity(String[] textLines, Diagnostic diagnostic, ValidationScope validationScope) at System.Activities.Validation.RoslynExpressionValidator.ProcessDiagnostics(ImmutableArray1 diagnostics, String text, ValidationScope validationScope) at System.Activities.Validation.RoslynExpressionValidator.Validate(Activity currentActivity, ValidationScope validationScope) at System.Activities.Validation.ValidationExtension.PostValidate(Activity activity) at System.Activities.Validation.ActivityValidationServices.InternalActivityValidationServices.b__7_1(IValidationExtension validationExtension) at System.Linq.Enumerable.SelectManySingleSelectorIterator2.MoveNext() at System.Collections.Generic.List1.InsertRange(Int32 index, IEnumerable1 collection) at System.Linq.Enumerable.ConcatIterator1.ToList() at System.Activities.Validation.ActivityValidationServices.InternalActivityValidationServices.InternalValidate() at System.Activities.Validation.ActivityValidationServices.Validate(Activity toValidate, ValidationSettings settings) at System.Activities.Presentation.Validation.ValidationService.CoreValidationWork(ValidationReason reason, CancellationToken cancellationToken)

I dont have dictionary variable in my workflow, but i am getting not present in dictionary error. Help me resolve this

Hi @gopikrishna529 ,

Could you maybe delete the variable fourth_previous_earnings_date and check whether it gets resolved ?

You can add it back once that error gets resolved or a different error pertaining to variable not declared error occurs.

A dictionary is a collection of values, not a string variable. Show us your code, you’re mixing things up.

@gopikrishna529
I’m also facing the same issue. Have you got the solution ?

Thanks,
Pravin