My automation is simple:
It gets values from my assets and sends them on a webhook to Power Automate.
It starts with a lookupobjects
objectTypeId = 262 AND "Host Status" IN ("Active") AND "Sharepoint" = True and "Groups" is not empty And "groupsharepoint" != True
then for each smart value
Name
{{testing}}
Smart value
{{lookupObjects}}
i send this request
{
"Name":"{{testing.Name}}", // name of the host
"Group name":"{{testing.Groups.Name}}",// name of the host's group
"Key":"{{testing.Groups.Key}}", // name of the host's group key
"Access Type":"Host access",
"Request type":"Create groups"
}
Groups being an object value in my Host asset attribute.
But even after specifying in the lookup object that the Groups field must not be empty, I still receive an empty value from Groups.Name and more often from Groups.Key since every item has a key, I doubt that it is empty
I have added a delay within the for-each loop (I don't know why I thought it would help :) )
I have decreased the lookupobjects item limit from 500 to 20 (maybe less item would help)
I have created a field in the host asset so I don't process repeated items. (And "groupsharepoint" != True)
I can't seem to get it right; it's like the values disappear in between the webhook and Power Automate.
This is an example of what im getting in power automate
"body": {
"Name": "Hostname",
"Group name": "PE-DPE, SG_ADMINS, Users, SG_SIR_ADMINS, SG_PATCH01IBM_Admins, SG_LOG02ALF_Admins, GitlabUsers, Salesforce System Administrator, SG_VPN_PRIO_Users, Remote Management Users, SG_Kyntech_SERVERSADMINS, SG_LINSAPROD01ALF_Operators, KAVWSEE Administrators, Print Operators, Access Control Assistance Operators, RDS Management Servers, SG_ARAQA01ALF_Operators, SG_COMP04IBM_Operators, SG_NETW_CCTV_ACCESS, KLOperators, Performance Log Users, Terminal Server License Servers, DnsAdmins, SG_JENKINS01ALF_Operators, Server Operators, Incoming Forest Trust Builders, Backup Operators, Domain Computers, Allowed RODC Password Replication Group, ADSyncBrowse, SG_VPN_CTT, Salesforce Infrastructure, Windows Authorization Access Group",
"Key": "SER04-992323, SER04-1315044, SER04-992355, SER04-992223, SER04-992279",
"Access Type": "Host access",
"Request type": "Create groups"
As you can see, I'm getting x group names, but the group keys are way less
Changing testig.groups.key to testig.groups works
Hi @Manuel Bernardino Marques da Silva
First thing: I am not using Assets, and my suggestions are based upon what I know about automation features in general. With that out of the way...
When using the Send Web Request action (and advanced edits with work items) there can be racetrack timing problems where some data may not process fast enough before the JSON is captured / validated for usage. I have noted multiple community questions where this can happen with Assets due to the just-in-time lookup of data.
The mitigation for this problem is pre-building the JSON for later use in the rule. For example:
This technique forces full evaluation of the smart values before they are needed later. It also helps to write the variable to the log to confirm it is well-formed and contains what is expected.
Kind regards,
Bill
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi @Bill Sheboy
Thank you for trying to help, changing testing.groups.key to just testing.groups worked :)
Kind regards,
M
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.