[Experimental] Let's try Dataverse Low-code Plugin (Automated)

Today, we will try the experience of creating Automated plug-ins using the latest Low Code Plugin from this documentation. For today's demonstration, I made the below tables (Header and Details) to do simple calculations (maybe).

Prepare the Environment

Before we start making the "low code" plugin, we must install the Dataverse Accelerator like in the step-by-step on the "Prerequisites for creating a low-code plug-in" here.

Here is my screenshot of when I install the Dataverse Accelerator app:

Attempt #1 Calculation Different Types (Money + Integer)

I created the below three columns for the demo (Qty, Price, and Total):

Total = Qty * Price

The idea is very simple. We will calculate the Total (Money attribute with the formula Qty (Integer) * with Price (Money). So, we can go to our Dataverse Accelerator App and create Automated plugins:

Create new Automated Plugin

Named it as UpdatedSetTotalDetail > Set the Table to the Table that you want to select (for my demo, the table is named Detail). Here you need to select the trigger of the plugin which I set to Updated. Then for the formula you can define it like below:

Patch(Details, ThisRecord, 
{
    'Total':Value(Text(Coalesce(ThisRecord.Qty, 0))) * 
        Value(Text(Coalesce(ThisRecord.Price, 0)))
})

As you can see, I put the Coalesceto check if there is a null value, and return it to null. Other than that I think you can understand the above operations very easily.

Here is the screenshot of my Automated Plugin that I want to test:

Automated Plugin to calculate total

Once done, you can click Save. You can open your App > the designated Table > trigger the update operation. For my result, I've got the below error:

Exception Message: One or more errors occurred.
ErrorCode: -2147220956
HexErrorCode: 0x80040224
HelpLink: http://go.microsoft.com/fwlink/?LinkID=398563&error=Microsoft.Crm.CrmException%3a80040224&client=platform
TraceText: [Microsoft.PowerFx.PlexPlugins: Microsoft.PowerFx.Evaluator][5844af97-fd07-ee11-8f6d-000d3a81886e: UpdatedSetTotalDetail]		In execute	Start message: Update, stage=PostOp, etn=tmy_detail 296ef7ed-ad07-ee11-8f6d-000d3a81886e, ver=1.0.0.0	tmy_detail:296ef7ed-ad07-ee11-8f6d-000d3a81886e	  tmy_price=Microsoft.Xrm.Sdk.Money	  tmy_qty=2	  tmy_price2=	  tmy_detailid=296ef7ed-ad07-ee11-8f6d-000d3a81886e	  modifiedon=6/11/2023 2:24:08 AM	  modifiedby=Microsoft.Xrm.Sdk.EntityReference	  modifiedonbehalfby=	  tmy_price_base=Microsoft.Xrm.Sdk.Money		Script threw One or more errors occurred., script: [compiled]Patch(Details, ThisRecord, 	{	    'Total':Value(Text(Coalesce(ThisRecord.Qty, 0))) * 	        Value(Text(Coalesce(ThisRecord.Price, 0)))	}), input: ???	Exception thrown: System.AggregateException: One or more errors occurred. ---> System.InvalidCastException: Unable to cast object of type 'Microsoft.PowerFx.Types.ErrorValue' to type 'Microsoft.PowerFx.Types.NumberValue'.	   at Microsoft.PowerFx.Dataverse.AttributeUtilityExtensions.ToAttributeObject(AttributeMetadata amd, FormulaValue fxValue)	   at Microsoft.PowerFx.Dataverse.DataverseExtensions.ConvertRecordToEntity(RecordValue record, EntityMetadata metadata, DValue`1& error, String methodName)	   at Microsoft.PowerFx.Dataverse.DataverseRecordValue.ConvertRecordToEntity(RecordValue record, DValue`1& error, String methodName)	   at Microsoft.PowerFx.Dataverse.DataverseRecordValue.<UpdateFieldsAsync>d__16.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.PowerFx.Dataverse.DataverseTableValue.<PatchCoreAsync>d__18.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.PowerFx.Types.TableValue.<PatchAsync>d__21.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.PowerFx.Functions.PatchFunction.<InvokeAsync>d__6.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.PowerFx.EvalVisitor.<Visit>d__35.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.PowerFx.ParsedExpression.<EvalAsync>d__9.MoveNext()	   --- End of inner exception stack trace ---	   at System.Threading.Tasks.Task`1.GetResultCore(Boolean waitCompletionNotification)	   at PowerPlexPlugin.RuleMessageHandler.<>c__DisplayClass16_1.<Eval>b__1()	   at Microsoft.PowerApps.CoreFramework.ActivityLoggerExtensions.Execute(ILogger logger, EventId eventId, ActivityType activityType, Action action, IEnumerable`1 additionalCustomProperties)	   at Microsoft.CDSRuntime.SandboxWorker.SandboxFirstPartyPluginLogger.Execute(String activityName, Action action, IEnumerable`1 additionalCustomProperties)	   at PowerPlexPlugin.RuleMessageHandler.Eval(CompiledExpression compiledExpression, RecordValue thisRecord, RecordValue prevRecord, Boolean useCache)	   at PowerPlexPlugin.RuleMessageHandler.RunDirect(CompiledExpression[] compiledExpressions, EventMessageName message)	   at PowerPlexPlugin.RuleMessageHandler.RunDirect(CompiledExpression compiledExpression, EventMessageName message)	   at PowerPlexPlugin.RuleMessageHandler.RunDirect(String compiledExpressionBase64, EventMessageName message)	   at Microsoft.PowerFx.Evaluator.ExecuteCore(DataverseServices services, PlexPluginContext Context, IOrganizationService service)	   at Microsoft.PowerFx.Evaluator.<>c__DisplayClass13_0.<Execute>b__0()	---> (Inner Exception #0) System.InvalidCastException: Unable to cast object of type 'Microsoft.PowerFx.Types.ErrorValue' to type 'Microsoft.PowerFx.Types.NumberValue'.	   at Microsoft.PowerFx.Dataverse.AttributeUtilityExtensions.ToAttributeObject(AttributeMetadata amd, FormulaValue fxValue)	   at Microsoft.PowerFx.Dataverse.DataverseExtensions.ConvertRecordToEntity(RecordValue record, EntityMetadata metadata, DValue`1& error, String methodName)	   at Microsoft.PowerFx.Dataverse.DataverseRecordValue.ConvertRecordToEntity(RecordValue record, DValue`1& error, String methodName)	   at Microsoft.PowerFx.Dataverse.DataverseRecordValue.<UpdateFieldsAsync>d__16.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.PowerFx.Dataverse.DataverseTableValue.<PatchCoreAsync>d__18.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.PowerFx.Types.TableValue.<PatchAsync>d__21.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.PowerFx.Functions.PatchFunction.<InvokeAsync>d__6.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.PowerFx.EvalVisitor.<Visit>d__35.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.PowerFx.ParsedExpression.<EvalAsync>d__9.MoveNext()<---		Exception thrown stack:    at System.Threading.Tasks.Task`1.GetResultCore(Boolean waitCompletionNotification)	   at PowerPlexPlugin.RuleMessageHandler.<>c__DisplayClass16_1.<Eval>b__1()	   at Microsoft.PowerApps.CoreFramework.ActivityLoggerExtensions.Execute(ILogger logger, EventId eventId, ActivityType activityType, Action action, IEnumerable`1 additionalCustomProperties)	   at Microsoft.CDSRuntime.SandboxWorker.SandboxFirstPartyPluginLogger.Execute(String activityName, Action action, IEnumerable`1 additionalCustomProperties)	   at PowerPlexPlugin.RuleMessageHandler.Eval(CompiledExpression compiledExpression, RecordValue thisRecord, RecordValue prevRecord, Boolean useCache)	   at PowerPlexPlugin.RuleMessageHandler.RunDirect(CompiledExpression[] compiledExpressions, EventMessageName message)	   at PowerPlexPlugin.RuleMessageHandler.RunDirect(CompiledExpression compiledExpression, EventMessageName message)	   at PowerPlexPlugin.RuleMessageHandler.RunDirect(String compiledExpressionBase64, EventMessageName message)	   at Microsoft.PowerFx.Evaluator.ExecuteCore(DataverseServices services, PlexPluginContext Context, IOrganizationService service)	   at Microsoft.PowerFx.Evaluator.<>c__DisplayClass13_0.<Execute>b__0()
Activity Id: 22d3a790-ade2-4ad2-a748-b10ca06df195

While testing almost similar operations in Canvas Apps, I can successfully update:

Testing via Canvas App

The above error happens because we got an issue with casting the value (which is unfortunately different from Canvas Apps and the new Dataverse Plugin Accelerator App). So because of that, we carry on to the second attempt!

Attempt #2 Calculation Same Types (Integer only)

Next, I created the below columns for testing purposes:

Three attributes with the same data type

Then, let's create a new Automated plugin (using Dataverse Accelerator App for sure) with the below formula:

Patch(Details, ThisRecord, 
{
    'Total 2':Value(Text(Coalesce(ThisRecord.Qty, 0))) * 
        Value(Text(Coalesce(ThisRecord.'Price 2', 0)))
})

Here is the screenshot of the Plugin:

UpdateDetailTotal2

Again, let's try the result and I've got the below error:

Exception Message: Entity.Attr[tmy_price2] isn't defined on metadata
ErrorCode: -2147220956
HexErrorCode: 0x80040224
HelpLink: http://go.microsoft.com/fwlink/?LinkID=398563&error=Microsoft.Crm.CrmException%3a80040224&client=platform
TraceText: [Microsoft.PowerFx.PlexPlugins: Microsoft.PowerFx.Evaluator][1d89df34-0108-ee11-8f6d-000d3a81886e: UpdateDetailTotal2]		In execute	Start message: Update, stage=PostOp, etn=tmy_detail 296ef7ed-ad07-ee11-8f6d-000d3a81886e, ver=1.0.0.0	tmy_detail:296ef7ed-ad07-ee11-8f6d-000d3a81886e	  tmy_price2=10	  tmy_qty=3	  tmy_detailid=296ef7ed-ad07-ee11-8f6d-000d3a81886e	  modifiedon=6/11/2023 2:41:02 AM	  modifiedby=Microsoft.Xrm.Sdk.EntityReference	  modifiedonbehalfby=		Exception thrown: System.InvalidOperationException: Entity.Attr[tmy_price2] isn't defined on metadata	   at PowerPlexPlugin.AttributeUtility.ValidateAttributes(CdsEntityMetadataProvider metadataProvider, Entity entity)	   at PowerPlexPlugin.RuleMessageHandler.RunDirect(CompiledExpression[] compiledExpressions, EventMessageName message)	   at PowerPlexPlugin.RuleMessageHandler.RunDirect(CompiledExpression compiledExpression, EventMessageName message)	   at PowerPlexPlugin.RuleMessageHandler.RunDirect(String compiledExpressionBase64, EventMessageName message)	   at Microsoft.PowerFx.Evaluator.ExecuteCore(DataverseServices services, PlexPluginContext Context, IOrganizationService service)	   at Microsoft.PowerFx.Evaluator.<>c__DisplayClass13_0.<Execute>b__0()	Exception thrown stack:    at PowerPlexPlugin.AttributeUtility.ValidateAttributes(CdsEntityMetadataProvider metadataProvider, Entity entity)	   at PowerPlexPlugin.RuleMessageHandler.RunDirect(CompiledExpression[] compiledExpressions, EventMessageName message)	   at PowerPlexPlugin.RuleMessageHandler.RunDirect(CompiledExpression compiledExpression, EventMessageName message)	   at PowerPlexPlugin.RuleMessageHandler.RunDirect(String compiledExpressionBase64, EventMessageName message)	   at Microsoft.PowerFx.Evaluator.ExecuteCore(DataverseServices services, PlexPluginContext Context, IOrganizationService service)	   at Microsoft.PowerFx.Evaluator.<>c__DisplayClass13_0.<Execute>b__0()
Activity Id: 34918405-8590-4382-a410-cc4a1c747a8a

Again, testing the above formula in the Canvas Apps verified okay:

Verifying again via Canvas Apps

So because of this issue, I stopped testing, and let's try to update the String value instead.

Attempt #3 Updating String Value

Because the existing table had a lookup at Header. Let's try to create a formula that will give the Primary Field with the formula "Header Name + Count Details. So here is my formula:

Patch(Details, ThisRecord, {Name: ThisRecord.Header.Name & "-" & CountRows(Filter(Details, Header.Header = ThisRecord.Header.Header)) & Now() });

Again, this still got an error like the below:

Exception Message: Illegal thread switch
ErrorCode: -2147220956
HexErrorCode: 0x80040224
HelpLink: http://go.microsoft.com/fwlink/?LinkID=398563&error=Microsoft.Crm.CrmException%3a80040224&client=platform
TraceText: [Microsoft.PowerFx.PlexPlugins: Microsoft.PowerFx.Evaluator][e7138c5f-0808-ee11-8f6d-000d3a81886e: Test3]		In execute	Start message: Create, stage=PostOp, etn=tmy_detail 5d240566-0808-ee11-8f6d-000d3a81886e, ver=1.0.0.0	tmy_detail:5d240566-0808-ee11-8f6d-000d3a81886e	  modifiedby=Microsoft.Xrm.Sdk.EntityReference	  ownerid=Microsoft.Xrm.Sdk.EntityReference	  modifiedon=6/11/2023 3:31:06 AM	  tmy_detailid=5d240566-0808-ee11-8f6d-000d3a81886e	  owningbusinessunit=Microsoft.Xrm.Sdk.EntityReference	  createdby=Microsoft.Xrm.Sdk.EntityReference	  tmy_header=Microsoft.Xrm.Sdk.EntityReference	  modifiedonbehalfby=	  statuscode=Microsoft.Xrm.Sdk.OptionSetValue	  tmy_name=From Automated Plugin	  createdon=6/11/2023 3:31:06 AM	  statecode=Microsoft.Xrm.Sdk.OptionSetValue		Script threw Illegal thread switch, script: [compiled]Patch(Details, ThisRecord, {Name: ThisRecord.Header.Name & "-" & CountRows(Filter(Details, Header.Header = ThisRecord.Header.Header)) & Now() });, input: ???	Exception thrown: System.InvalidOperationException: Illegal thread switch	   at PowerPlexPlugin.ThreadCheck.Validate()	   at PowerPlexPlugin.LiveMetadataProvider.TryGetEntityMetadata(String logicalOrDisplayName, EntityMetadata& entity)	   at Microsoft.PowerFx.Dataverse.CdsEntityMetadataProvider.TryGetXrmEntityMetadata(String logicalName, EntityMetadata& xrmEntity)	   at Microsoft.PowerFx.Dataverse.CdsEntityMetadataProvider.TryGetDataSource(String logicalName, String variableName, DataverseDataSourceInfo& dataSource)	   at Microsoft.PowerFx.Dataverse.CdsEntityMetadataProvider.Microsoft.PowerFx.Core.Entities.Delegation.IExternalDataEntityMetadataProvider.TryGetEntityMetadata(String expandInfoIdentity, IDataEntityMetadata& entityMetadata)	   at Microsoft.PowerFx.Core.Types.DType.TryGetEntityDelegationMetadata(IDelegationMetadata& metadata)	   at Microsoft.PowerFx.Core.Binding.TexlBinding.Visitor.GetExpandedEntityType(DType expandEntityType, String relatedEntityPath)	   at Microsoft.PowerFx.Core.Binding.TexlBinding.Visitor.GetEntitySchema(DType entityType, DottedNameNode node)	   at Microsoft.PowerFx.Core.Binding.TexlBinding.Visitor.PostVisit(DottedNameNode node)	   at Microsoft.PowerFx.Syntax.DottedNameNode.Accept(TexlVisitor visitor)	   at Microsoft.PowerFx.Syntax.DottedNameNode.Accept(TexlVisitor visitor)	   at Microsoft.PowerFx.Syntax.BinaryOpNode.Accept(TexlVisitor visitor)	   at Microsoft.PowerFx.Syntax.BinaryOpNode.Accept(TexlVisitor visitor)	   at Microsoft.PowerFx.Syntax.BinaryOpNode.Accept(TexlVisitor visitor)	   at Microsoft.PowerFx.Syntax.VariadicBase.AcceptChildren(TexlVisitor visitor)	   at Microsoft.PowerFx.Syntax.RecordNode.Accept(TexlVisitor visitor)	   at Microsoft.PowerFx.Core.Binding.TexlBinding.Visitor.PreVisitBottomUp(CallNode node, Int32 argCountVisited, Scope scopeNew)	   at Microsoft.PowerFx.Core.Binding.TexlBinding.Visitor.PreVisit(CallNode node)	   at Microsoft.PowerFx.Syntax.CallNode.Accept(TexlVisitor visitor)	   at Microsoft.PowerFx.Core.Binding.TexlBinding.Visitor.PreVisit(VariadicOpNode node)	   at Microsoft.PowerFx.Syntax.VariadicOpNode.Accept(TexlVisitor visitor)	   at Microsoft.PowerFx.Core.Binding.TexlBinding.Run(IBinderGlue glue, IExternalRuleScopeResolver scopeResolver, DataSourceToQueryOptionsMap queryOptionsMap, TexlNode node, INameResolver resolver, BindingConfig bindingConfig, Boolean updateDisplayNames, DType ruleScope, Boolean forceUpdateDisplayNames, IExternalRule rule, Features features)	   at Microsoft.PowerFx.Engine.ComputeBinding(CheckResult result)	   at Microsoft.PowerFx.CheckResult.ApplyBindingInternal()	   at Microsoft.PowerFx.Engine.CheckWorker(CheckResult check)	   at Microsoft.PowerFx.Engine.Check(String expressionText, ParserOptions options, ReadOnlySymbolTable symbolTable)	   at PowerPlexPlugin.Core.EditorContextScopeHelper.Check(String expression)	   at PowerPlexPlugin.Core.EngineFactory.Restore(CompiledExpression compiledExpression)	   at PowerPlexPlugin.RuleMessageHandler.<>c__DisplayClass16_1.<Eval>b__0()	   at Microsoft.PowerApps.CoreFramework.ActivityLoggerExtensions.Execute(ILogger logger, EventId eventId, ActivityType activityType, Action action, IEnumerable`1 additionalCustomProperties)	   at Microsoft.CDSRuntime.SandboxWorker.SandboxFirstPartyPluginLogger.Execute(String activityName, Action action, IEnumerable`1 additionalCustomProperties)	   at PowerPlexPlugin.RuleMessageHandler.Eval(CompiledExpression compiledExpression, RecordValue thisRecord, RecordValue prevRecord, Boolean useCache)	   at PowerPlexPlugin.RuleMessageHandler.RunDirect(CompiledExpression[] compiledExpressions, EventMessageName message)	   at PowerPlexPlugin.RuleMessageHandler.RunDirect(CompiledExpression compiledExpression, EventMessageName message)	   at PowerPlexPlugin.RuleMessageHandler.RunDirect(String compiledExpressionBase64, EventMessageName message)	   at Microsoft.PowerFx.Evaluator.ExecuteCore(DataverseServices services, PlexPluginContext Context, IOrganizationService service)	   at Microsoft.PowerFx.Evaluator.<>c__DisplayClass13_0.<Execute>b__0()	Exception thrown stack:    at PowerPlexPlugin.ThreadCheck.Validate()	   at PowerPlexPlugin.LiveMetadataProvider.TryGetEntityMetadata(String logicalOrDisplayName, EntityMetadata& entity)	   at Microsoft.PowerFx.Dataverse.CdsEntityMetadataProvider.TryGetXrmEntityMetadata(String logicalName, EntityMetadata& xrmEntity)	   at Microsoft.PowerFx.Dataverse.CdsEntityMetadataProvider.TryGetDataSource(String logicalName, String variableName, DataverseDataSourceInfo& dataSource)	   at Microsoft.PowerFx.Dataverse.CdsEntityMetadataProvider.Microsoft.PowerFx.Core.Entities.Delegation.IExternalDataEntityMetadataProvider.TryGetEntityMetadata(String expandInfoIdentity, IDataEntityMetadata& entityMetadata)	   at Microsoft.PowerFx.Core.Types.DType.TryGetEntityDelegationMetadata(IDelegationMetadata& metadata)	   at Microsoft.PowerFx.Core.Binding.TexlBinding.Visitor.GetExpandedEntityType(DType expandEntityType, String relatedEntityPath)	   at Microsoft.PowerFx.Core.Binding.TexlBinding.Visitor.GetEntitySchema(DType entityType, DottedNameNode node)	   at Microsoft.PowerFx.Core.Binding.TexlBinding.Visitor.PostVisit(DottedNameNode node)	   at Microsoft.PowerFx.Syntax.DottedNameNode.Accept(TexlVisitor visitor)	   at Microsoft.PowerFx.Syntax.DottedNameNode.Accept(TexlVisitor visitor)	   at Microsoft.PowerFx.Syntax.BinaryOpNode.Accept(TexlVisitor visitor)	   at Microsoft.PowerFx.Syntax.BinaryOpNode.Accept(TexlVisitor visitor)	   at Microsoft.PowerFx.Syntax.BinaryOpNode.Accept(TexlVisitor visitor)	   at Microsoft.PowerFx.Syntax.VariadicBase.AcceptChildren(TexlVisitor visitor)	   at Microsoft.PowerFx.Syntax.RecordNode.Accept(TexlVisitor visitor)	   at Microsoft.PowerFx.Core.Binding.TexlBinding.Visitor.PreVisitBottomUp(CallNode node, Int32 argCountVisited, Scope scopeNew)	   at Microsoft.PowerFx.Core.Binding.TexlBinding.Visitor.PreVisit(CallNode node)	   at Microsoft.PowerFx.Syntax.CallNode.Accept(TexlVisitor visitor)	   at Microsoft.PowerFx.Core.Binding.TexlBinding.Visitor.PreVisit(VariadicOpNode node)	   at Microsoft.PowerFx.Syntax.VariadicOpNode.Accept(TexlVisitor visitor)	   at Microsoft.PowerFx.Core.Binding.TexlBinding.Run(IBinderGlue glue, IExternalRuleScopeResolver scopeResolver, DataSourceToQueryOptionsMap queryOptionsMap, TexlNode node, INameResolver resolver, BindingConfig bindingConfig, Boolean updateDisplayNames, DType ruleScope, Boolean forceUpdateDisplayNames, IExternalRule rule, Features features)	   at Microsoft.PowerFx.Engine.ComputeBinding(CheckResult result)	   at Microsoft.PowerFx.CheckResult.ApplyBindingInternal()	   at Microsoft.PowerFx.Engine.CheckWorker(CheckResult check)	   at Microsoft.PowerFx.Engine.Check(String expressionText, ParserOptions options, ReadOnlySymbolTable symbolTable)	   at PowerPlexPlugin.Core.EditorContextScopeHelper.Check(String expression)	   at PowerPlexPlugin.Core.EngineFactory.Restore(CompiledExpression compiledExpression)	   at PowerPlexPlugin.RuleMessageHandler.<>c__DisplayClass16_1.<Eval>b__0()	   at Microsoft.PowerApps.CoreFramework.ActivityLoggerExtensions.Execute(ILogger logger, EventId eventId, ActivityType activityType, Action action, IEnumerable`1 additionalCustomProperties)	   at Microsoft.CDSRuntime.SandboxWorker.SandboxFirstPartyPluginLogger.Execute(String activityName, Action action, IEnumerable`1 additionalCustomProperties)	   at PowerPlexPlugin.RuleMessageHandler.Eval(CompiledExpression compiledExpression, RecordValue thisRecord, RecordValue prevRecord, Boolean useCache)	   at PowerPlexPlugin.RuleMessageHandler.RunDirect(CompiledExpression[] compiledExpressions, EventMessageName message)	   at PowerPlexPlugin.RuleMessageHandler.RunDirect(CompiledExpression compiledExpression, EventMessageName message)	   at PowerPlexPlugin.RuleMessageHandler.RunDirect(String compiledExpressionBase64, EventMessageName message)	   at Microsoft.PowerFx.Evaluator.ExecuteCore(DataverseServices services, PlexPluginContext Context, IOrganizationService service)	   at Microsoft.PowerFx.Evaluator.<>c__DisplayClass13_0.<Execute>b__0()
Activity Id: 95af43c2-eeb8-4dba-b3a7-5c1e49e45472

So I ended up only can testing for very simple scenarios where we put the hardcoded values there:

Patch(Details, LookUp(Details, Detail = GUID(Id)), 
{Name: "Temmy here" })

Let's give the project more mature and I'll retest it again. 😊

Leave a comment

Your comment is sent privately to the author and isn't published on the site.