2017-12-11 34 views
0

저는 이것을 시도하고 있지만 작동하지 않습니다.Json Array에 논리 응용 프로그램의 객체가 포함되어 있는지 확인하십시오.

@contains(json(body('ParseCustomerDeltaXML')).newMembers[0], 'Member') 

하지만 난 일하러 못할 : 조건 커넥터에서

나는이 일을하고 있습니다.

회원이 포함되어 있으면 참이라고 말합니다.

하지만 난 오류 얻을 경우 :

오류 메시지에 표시된 바와 같이

InvalidTemplate. Unable to process template language expressions for action 'Condition' at line '1' and column '2706': 'The template language expression 'equals(json(body('ParseCustomerDeltaXML')).newMembers[0], null)' cannot be evaluated because array index '0' cannot be selected from empty array. Please see https://aka.ms/logicexpressions for usage details.'.

답변

0

, 배열이 비어의 첫 번째 항목을 참조하려고합니다. 안전한 참조 연산자를 사용하려고합니다. .?

newMembers이 빈 배열이라고 가정합니다. 그런 다음 newMembers[0]은 실패하지만 newMembers?[0]은 성공하고 null을 반환합니다.

설명하는 특정 시나리오에서 중첩 조건을 사용해야 할 수도 있습니다 (예 : newMembers가 비어 있지 않은지 먼저 확인한 다음 멤버십을 확인).

공 없음을 확인하려면 @empty() 표현식을 사용할 수 있습니다.