I have a multi-select field client(s). When that field is updated, I want to update custom field Salesforce Account which is a multi select asset field so that each selection in Client(s) will have the corresponding assets field in Salesforce Account.
Note: For a single select field client, Automation to populate Salesforce Account is working perfectly. (not the rule below, a simpler rule, but my lookup is working perfectly)
Here is the automation rule:
The audit log shows that the automation does find the correct object keys;
The advanced editing JSON:
When I run this rule I get this error:
I tried "set", did not work, got an error as well.
I think there's some hidden trick out there and I can't seem to find it.
Everyone's answers are right, let me put it all together for your exact use case that I also had not to long ago.
1. Trigger: needs to be the field updated for your select field
2. action: Lookup objects with this query: (Please replace Services List with the name of your select list field or even better the custom field id)
Name in ({{#issue.Services List}}"{{value}}"{{^last}},{{/}}{{/}})
3. next action: edit issue where you will edit the asset field and add the query exactly:
Key in ({{lookupObjects}})
That's all there is to it!
Hi Andrea,
I set it up like this:
BUT failed:
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Resolved!! I put the asset field in, instead of the regular field (duh).
Worked beautifully. Thank you so much @Andrea Robbins
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You could simplify this, this is how I do it for a custom field that sets approvers based on what we have in Assets.
The value you get from Assets is an array, so in order to set the custom field you need to replace the commas and the brackets. The way I do it is assign the output from lookupObjects to a variable and then do the replace on that variable. Once that is done you can set the Asset custom field by using Key IN ('{{approvers}}').
The first variable (approve) is just getting the value of {{lookupObjects.Approvers}} and then in the second one the replacement happens using {{approve.replace(", ",",").replace("[","").replace("]","")}}.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
And the reason I am using two variables is because for some reason the text conversion is not working when doing it directly on lookupObjects on our environment.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hello @Susan Hauth _Jira Queen_
I found an answer in this post that shows an example of setting a multiple selection asset object field, but it is using explicit object keys. I'm still looking for an example where the data came from an Lookup Objects action.
The original question and answer were for the Server/DC environment, but there is additional information from another contributor on a solution for Cloud. I have not tested it myself.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.