- 필수 기능
- 시작하기
- Glossary
- 표준 속성
- Guides
- Agent
- 통합
- 개방형텔레메트리
- 개발자
- API
- Datadog Mobile App
- CoScreen
- Cloudcraft
- 앱 내
- 서비스 관리
- 인프라스트럭처
- 애플리케이션 성능
- APM
- Continuous Profiler
- 스팬 시각화
- 데이터 스트림 모니터링
- 데이터 작업 모니터링
- 디지털 경험
- 소프트웨어 제공
- 보안
- AI Observability
- 로그 관리
- 관리
To set a mutable workflow variable, use the Set variable action. You can use this action to declare, update, and access variables throughout your workflow, which allows you to perform more complex workflow operations. For example:
To set a variable:
{{
if you want to use a workflow context variable.If you need to change the value of a variable after setting it, you must add an additional Set variable step and either reassign the variable or create a new variable.
Here is an example of a workflow that demonstrates the Set variable step:
intList
and give it the value [1,2,3,4]
.$.Variables.intList.filter(number => number % 2 === 0)
to filter out the odd numbers.[2,4]
) to a new variable named evenList
.evenList
.You can access a variable in your workflow using {{ Variables.variableName }}
. For example, to access a variable named DashboardList
, use {{ Variables.DashboardList }}
.
Setting a variable inside a For loop allows you store data for use outside of the loop. For example, if you’re making multiple API requests inside a For loop, you can set a variable and append the data you need to it on each iteration. Outside of the loop, you can access the variable and handle the data you collected.
To avoid a type error resulting from an undefined variable, assign a variable before you use it in a loop. In the example below, the variable evenList
is set to an empty array before it is used in the loop.
추가 유용한 문서, 링크 및 기사:
Do you have questions or feedback? Join the #workflows channel on the Datadog Community Slack.