How to add variable inside ACF and push a value based on trigger like page ID?

How to add variable inside ACF and push a value based on trigger like page ID?
Should we create a varaible inside ACF plugin and a theme template needs IF sentence?
An example: IF PAGE is a CITY than push CITYID

You can add a variable inside ACF using the acf_add_local_field_group() function. In this function, you define a group of fields and their parameters, including the field name and type, the field ID, and display rules, such as conditions that determine when the field should be displayed. For example, if you need to pass a value based on a trigger, you can use a mapping rule that checks the page ID.

Thank you for the message!