Skip to content

If condition for checking exist for each field #305

Description

@RajGrasko
 "#ifgroup(#existsandnotempty($.coordinators))": {
   "coordinators": {
     "#loop($.coordinators)": {
       "#ifgroup(#or(#existsandnotempty($.coordinator_type), #existsandnotempty($.coordinator_id)))": {
         "coordinator_type": "#ifgroup(#existsandnotempty($.coordinator_type)) #valueof($.coordinator_type)",
         "coordinator_id": "#ifgroup(#existsandnotempty($.coordinator_id)) #valueof($.coordinator_id)"
       }
     }
   }
 }
 is this correct for array
 and below one for object
   "#ifgroup(#or(#existsandnotempty($.acuity_info.acuity), #existsandnotempty($.acuity_info.billing_acuity), #existsandnotempty($.acuity_info.transportation_assistance)))": {
    "acuity_info": {
      "#ifgroup(#existsandnotempty($.acuity_info.acuity))": {
        "acuity": "#valueof($.acuity_info.acuity)"
      },
      "#ifgroup(#existsandnotempty($.acuity_info.billing_acuity))": {
        "billing_acuity": "#valueof($.acuity_info.billing_acuity)"
      },
      "#ifgroup(#existsandnotempty($.acuity_info.transportation_assistance))": {
        "transportation_assistance": "#valueof($.acuity_info.transportation_assistance)"
      }
    }
  },
  

and how to remove empty condition, i only want exists condition

also, how to check or condition for if group,?
"#ifgroup(#or(#existsandnotempty($.schedule_settings.ignore_double_booking), #existsandnotempty($.schedule_settings.ignore_deviation)))": { "schedule_settings": { "#ifgroup(#existsandnotempty($.schedule_settings.ignore_double_booking))": { "ignore_double_booking": "#valueof($.schedule_settings.ignore_double_booking)" }, "#ifgroup(#existsandnotempty($.schedule_settings.ignore_deviation))": { "ignore_deviation": "#valueof($.schedule_settings.ignore_deviation)" } } }

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions