Hi, I’m trying to make sure a debtor called “Shopify” is selected in the execution of a command. However I’m not allowed to enter a string literal in the search-up, but I need to assign this Debtor the name “Shopify”. How could I accomplish this?
'Debtor' = switch ^ ^ .'Financial' (
| 'From Shopify' => switch $ .'Debtors' [ "Shopify" ] (
| node => create 'Existing' ( 'Debtor' = "Shopify" )
| none => create 'New This Year' ( 'Debtor' = "Shopify" )
)
You can do this:
'Default Debtor': text ~> .'Debtors'[] = "Shopify"
....
'Debtor' = switch ^ ^ .'Financial' (
| 'From Shopify' => switch >'Default Debtor' (
| node as $ => create 'Existing' ( 'Debtor' = $ .'Name' )
| none => create 'New This Year' ( 'Debtor' = .'Default Debtor' )
)
)
But, I recommend that you do not use a constant string value in your model, and instead make this apparent default Debtor
configurable (i.e. make Default Debtor
a base value), such that you do not have to update the app if the name of the Default Debtor
ever changes.