Hardware Asset filter by Owner

Andrea_ZorziAndrea_Zorzi Customer IT Monkey ✭
Hi,
I'm currently using this API "Projection/GetProjectionByCriteria"  to retrieve the hardware asset values using the following query in order to filter them by name:
"SimpleExpression": {
               "ValueExpressionLeft": {
                       "Property": "$Context/Property[Type='81e3da4f-e41c-311e-5b05-3ca779d030db']/Name$"              
               },
               "Operator": "Like",
               "ValueExpressionRight": {
                       "Value": "%test%"              
               }
        }
and the result is correct. 
Now i would like to filter the hardware asset also for the Owner field, for this reason I added this part to the query:
        "SimpleExpression": {
               "ValueExpressionLeft": {
                        "Property": "$Context/Path[Relationship='cbb45424-b0a2-72f0-d535-541941cdf8e1' TypeConstraint='55270a70-ac47-c853-c617-236b0cff9b4c']/Property[Type='55270a70-ac47-c853-c617-236b0cff9b4c']/DisplayName$"
                },
               "Operator": "Like",
               "ValueExpressionRight": { "Value": "%%" }
        }
but this is not working.
Is it possible to filter also the owner field ? If yes, How is it possible ?
 
Thank,
Andrea

Answers

  • Ilias_El_TaghadouiniIlias_El_Taghadouini Customer IT Monkey ✭
    Hello Andrea,

    I was able to get this working like this:

    "Expression": [{
                                                    "SimpleExpression": {
                                                        "ValueExpressionLeft": {
                                                            //System.user Projection
                                                            "Property": "$Context/Path[Relationship='cbb45424-b0a2-72f0-d535-541941cdf8e1' TypeConstraint='eca3c52a-f273-5cdc-f165-3eb95a2b26cf']/Property[Type='eca3c52a-f273-5cdc-f165-3eb95a2b26cf']/UserName$"                                            
                                                        },
                                                        "Operator": "Equals",
                                                        "ValueExpressionRight": {
                                                            "Value": val
                                                            
                                                        }            
                                                    }          
                                                }]         

    The "val" variable gets populated with the user id from an autocomplete linked to another datasource

    Hope it helps
Sign In or Register to comment.