Skip to content

Instantly share code, notes, and snippets.

@machv
Created June 9, 2020 13:17
Show Gist options
  • Save machv/ef4ade36b9887d1db79d7e0fe7d3ce71 to your computer and use it in GitHub Desktop.
Save machv/ef4ade36b9887d1db79d7e0fe7d3ce71 to your computer and use it in GitHub Desktop.
RC -> Datum narozeni (PowerAutomate)

Clean RC expression

Type: Data Operation Action: Compose

Expression:

replace(replace(outputs('RC'), '/', ''), ' ', '')

Datum narozeni expression

Type: Data Operation Action: Compose

Expression:

formatDateTime(
  concat(
    string(
       if(
          and(
              equals(length(outputs('Clean_RC')), 10),
              less(int(substring(outputs('Clean_RC'), 0, 2)), 54)
          ),
          add(
              int(
                  substring(outputs('Clean_RC'), 0, 2)
              ), 
              2000
          ),
          add(
              int(
                  substring(outputs('Clean_RC'), 0, 2)
             ),
             1900
          )
       )
    ),
    '-',
    string(
      formatNumber(
         sub(
             int(substring(outputs('Clean_RC'), 2, 2)), 
             if(
                greater(
                        int(substring(outputs('Clean_RC'), 2, 2)),
                        12
                ), 
                50,
                0
             )
         )
      ,'D2')
    ),
    '-',
    substring(outputs('Clean_RC'), 4, 2)
  ),
  'yyyy-MM-dd'
)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment